Skip to content

Commit 5788dc9

Browse files
authored
Merge pull request #136 from movabletype/restore_oracle
Restore oracle
2 parents fd7bfdd + 20f0c68 commit 5788dc9

5 files changed

Lines changed: 159 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ Dockerfile to test MT.
3636
|noble|ubuntu:noble|5.38.2|8.3.6|8.4.3|3.0.13|-|
3737
|amazonlinux|amazonlinux:2|5.16.3|7.4.33|MariaDB 5.5.68|1.0.2k|-|
3838
|amazonlinux2022 (\*4)|amazonlinux:2023|5.32.1|8.3.7|MariaDB 10.5.25|3.0.8|-|
39-
|oracle8 (\*3)|oraclelinux:8|5.26.3|8.2.27|MariaDB 10.3.39|1.1.1k|-|
39+
|oracle (\*3)|oraclelinux:7-slim|5.16.3|7.4.33|MariaDB 5.5.68|1.0.2k|-|
40+
|oracle8 (\*3)|oraclelinux:8-slim|5.26.3|8.2.27|MariaDB 10.3.39|1.1.1k|-|
4041

4142
\*2 These images were used to test older versions of MT.
4243
\*3 with DBD::Oracle 1.80 + OracleInstantClient 21.7

bin/test_readme.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
for my $key (sort keys %{ $mapping{$image} }) {
3838
if ($key eq 'base') {
3939
my $dockerfile = path("$image/Dockerfile")->slurp;
40-
my ($from) = $dockerfile =~ /FROM ([\w:\/]+)/;
40+
my ($from) = $dockerfile =~ /FROM ([\w:\/-]+)/;
4141
is $from => $mapping{$image}{$key} => "$image has correct $key";
4242
next;
4343
}

bin/update_dockerfile.pl

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,64 @@
754754
phpunit => 11,
755755
locale_def => 1,
756756
},
757+
oracle => {
758+
from => 'oraclelinux:7-slim',
759+
base => 'centos',
760+
yum => {
761+
_replace => {
762+
'mysql' => 'mariadb',
763+
'mysql-server' => 'mariadb-server',
764+
'mysql-devel' => 'mariadb-devel',
765+
'php' => '',
766+
'php-gd' => '',
767+
'php-mysqlnd' => '',
768+
'php-mbstring' => '',
769+
'php-pecl-memcache' => '',
770+
'phpunit' => '',
771+
'giflib-devel' => '',
772+
'gd-devel' => '',
773+
'libwebp-devel' => '',
774+
'GraphicsMagick' => '',
775+
'GraphicsMagick-perl' => '',
776+
'icc-profiles-openicc' => '',
777+
'ruby' => '',
778+
'ruby-devel' => '',
779+
'clang' => '',
780+
},
781+
base => [qw( which )],
782+
server => [qw( httpd )],
783+
},
784+
epel => {
785+
rpm => 'oracle-epel-release-el7',
786+
enable => 'ol7_developer_EPEL',
787+
},
788+
ol7_developer_php74 => {
789+
rpm => 'oracle-php-release-el7',
790+
enable => 'ol7_developer_php74',
791+
},
792+
instantclient => {
793+
rpm => 'https://download.oracle.com/otn_software/linux/instantclient/217000/oracle-instantclient-basic-21.7.0.0.0-1.x86_64.rpm',
794+
},
795+
repo => {
796+
ol7_optional_latest => [qw( gd-devel giflib-devel libwebp-devel libstdc++-static )],
797+
ol7_developer_php74 => [qw( php php-mysqlnd php-gd php-mbstring phpunit php-oci8-21c )],
798+
epel => [qw( GraphicsMagick-perl-1.3.32-1.el7 clang )],
799+
},
800+
cpan => {
801+
no_test => [qw( DBI Test::NoWarnings )],
802+
missing => [qw( DBD::Oracle )],
803+
broken => [qw( SQL::Translator@1.63 )],
804+
_replace => {
805+
'Imager::File::WEBP' => '', # libwebp for oracle is too old (0.3.0 as of this writing)
806+
},
807+
},
808+
make => {
809+
ruby => '2.7.8',
810+
},
811+
make_dummy_cert => '/etc/pki/tls/certs/',
812+
phpunit => 9,
813+
release => 19.6,
814+
},
757815
oracle8 => {
758816
from => 'oraclelinux:8-slim',
759817
base => 'centos',

oracle/Dockerfile

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
FROM oraclelinux:7-slim
2+
3+
WORKDIR /root
4+
5+
6+
RUN yum -y install\
7+
which git make cmake gcc curl perl perl-core tar zip unzip bzip2 which procps postfix\
8+
mariadb-devel mariadb-server mariadb\
9+
vim nano\
10+
ImageMagick-perl perl-GD netpbm-progs ImageMagick libpng-devel libjpeg-devel\
11+
libxml2-devel expat-devel openssl-devel openssl gmp-devel\
12+
httpd mod_ssl vsftpd ftp memcached\
13+
&&\
14+
yum -y install https://download.oracle.com/otn_software/linux/instantclient/217000/oracle-instantclient-basic-21.7.0.0.0-1.x86_64.rpm &&\
15+
yum -y install oracle-instantclient-basic oracle-instantclient-release-el7 &&\
16+
yum -y install oracle-instantclient-devel oracle-instantclient-sqlplus &&\
17+
yum -y reinstall glibc-common &&\
18+
yum -y install oracle-epel-release-el7 &&\
19+
yum -y --enablerepo=ol7_developer_EPEL install\
20+
GraphicsMagick-perl-1.3.32-1.el7 clang\
21+
&& yum clean --enablerepo=ol7_developer_EPEL all &&\
22+
yum -y install oracle-php-release-el7 &&\
23+
yum -y --enablerepo=ol7_developer_php74 install\
24+
php php-mysqlnd php-gd php-mbstring phpunit php-oci8-21c\
25+
&& yum clean --enablerepo=ol7_developer_php74 all &&\
26+
yum -y --enablerepo=ol7_optional_latest install\
27+
gd-devel giflib-devel libwebp-devel libstdc++-static\
28+
&&\
29+
yum -y update --skip-broken &&\
30+
yum clean all && rm -rf /var/cache/yum &&\
31+
mkdir src && cd src &&\
32+
curl -LO https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.8.tar.gz && tar xf ruby-2.7.8.tar.gz &&\
33+
cd ruby-2.7.8 && ./configure --enable-shared --disable-install-doc && make -j4 && make install && cd .. &&\
34+
cd .. && rm -rf src && ldconfig /usr/local/lib &&\
35+
curl -sL https://phar.phpunit.de/phpunit-9.phar > phpunit && chmod +x phpunit &&\
36+
mv phpunit /usr/local/bin/ &&\
37+
(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | bash) &&\
38+
gem install \
39+
fluentd\
40+
&&\
41+
curl -sL https://cpanmin.us > cpanm && chmod +x cpanm && perl -pi -E 's{http://(www\.cpan\.org|backpan\.perl\.org|cpan\.metacpan\.org|fastapi\.metacpan\.org|cpanmetadb\.plackperl\.org)}{https://$1}g' cpanm && mv cpanm /usr/local/bin &&\
42+
curl -sL --compressed https://git.io/cpm > cpm &&\
43+
chmod +x cpm &&\
44+
mv cpm /usr/local/bin/ &&\
45+
cpanm -n DBI Test::NoWarnings XMLRPC::Lite XML::Atom Net::Server Perl::Critic::Pulp Selenium::Remote::Driver &&\
46+
cpanm -v SQL::Translator@1.63 Archive::Zip@1.65 DBD::mysql@4.050 HTTP::Message@6.46 &&\
47+
cpanm -v \
48+
pQuery\
49+
JSON::XS Starman Plack::Middleware::ReverseProxy\
50+
JavaScript::Minifier CSS::Minifier\
51+
DBD::Oracle\
52+
Fluent::Logger\
53+
&& curl -sLO https://raw.githubusercontent.com/movabletype/movabletype/develop/t/cpanfile &&\
54+
cpanm --installdeps -v . &&\
55+
rm -rf cpanfile /root/.perl-cpm /root/.cpanm /root/.qws
56+
57+
ENV LANG=en_US.UTF-8 \
58+
LC_ALL=en_US.UTF-8
59+
60+
RUN set -ex &&\
61+
perl -i -pe \
62+
's!AllowOverride None!AllowOverride All!g; s!#AddEncoding x-gzip \.gz \.tgz!AddEncoding x-gzip .gz .tgz .svgz!g;' \
63+
/etc/httpd/conf/httpd.conf &&\
64+
perl -e 'my ($inifile) = `php --ini` =~ m!Loaded Configuration File:\s+(/\S+/php.ini)!; \
65+
my $ini = do { open my $fh, "<", $inifile; local $/; <$fh> }; \
66+
$ini =~ s!^;\s*date\.timezone =!date\.timezone = "Asia/Tokyo"!m; \
67+
open my $fh, ">", $inifile; print $fh $ini' &&\
68+
sed -i -E 's/inet_protocols = all/inet_protocols = ipv4/' /etc/postfix/main.cf
69+
70+
RUN cd /etc/pki/tls/certs/ && ./make-dummy-cert /etc/pki/tls/certs/localhost.crt &&\
71+
perl -i -pe 's!SSLCertificateKeyFile /etc/pki/tls/private/localhost.key!!' \
72+
/etc/httpd/conf.d/ssl.conf && cd $WORKDIR
73+
74+
COPY ./docker-entrypoint.sh /
75+
ENTRYPOINT ["/docker-entrypoint.sh"]

oracle/docker-entrypoint.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -e
3+
4+
mysql_install_db --user=mysql --skip-name-resolve --force >/dev/null
5+
6+
bash -c "cd /usr; mysqld_safe --user=mysql --datadir=/var/lib/mysql &"
7+
sleep 1
8+
until mysqladmin ping -h localhost --silent; do
9+
echo 'waiting for mysqld to be connectable...'
10+
sleep 1
11+
done
12+
13+
mysql -e "create database mt_test character set utf8;"
14+
mysql -e "create user mt@localhost;"
15+
mysql -e "grant all privileges on mt_test.* to mt@localhost;"
16+
17+
memcached -d -u root
18+
19+
if [ -f t/cpanfile ]; then
20+
cpanm --installdeps -n . --cpanfile=t/cpanfile
21+
fi
22+
23+
exec "$@"

0 commit comments

Comments
 (0)