Skip to content

Commit d498539

Browse files
authored
Merge pull request #139 from movabletype/postgresql
Postgresql
2 parents 6027f15 + 1a4a72d commit d498539

6 files changed

Lines changed: 219 additions & 46 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ 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+
|postgresql|fedora:41|5.40.1|8.3.16|Postgres 16.3|3.2.2|-|
3940
|oracle (\*3)|oraclelinux:7-slim|5.16.3|7.4.33|MariaDB 5.5.68|1.0.2k|-|
4041
|oracle8 (\*3)|oraclelinux:8-slim|5.26.3|8.2.27|MariaDB 10.3.39|1.1.1k|-|
4142

bin/checker.t

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ use warnings;
33
use Test::More;
44
use version;
55

6+
my $image_name = $ENV{TEST_IMAGE};
7+
8+
diag "\nChecking $image_name";
9+
610
my %prereqs = (
711
'Archive::Tar' => '',
812
'Archive::Zip' => '<= 1.65?(cloud6|cloud7|addons)',
9-
'DBD::mysql' => '4.000',
1013
'DBI' => '1.633',
1114
'GD' => 0,
1215
'Graphics::Magick' => 0,
@@ -18,9 +21,11 @@ my %prereqs = (
1821
'IO::Socket::SSL' => '2.058',
1922
);
2023

21-
my $image_name = $ENV{TEST_IMAGE};
22-
23-
diag "\nChecking $image_name";
24+
if ($image_name eq 'postgresql') {
25+
$prereqs{'DBD::Pg'} = 0;
26+
} else {
27+
$prereqs{'DBD::mysql'} = '4.000';
28+
}
2429

2530
# temporary files
2631

@@ -139,19 +144,23 @@ ok $phpinfo =~ /(?:
139144
Zend[ ]Multibyte[ ]Support[ ]=>[ ]provided[ ]by[ ]mbstring |
140145
mbstring[ ]extension[ ]makes[ ]use[ ]of[ ]"streamable[ ]kanji[ ]code[ ]filter[ ]and[ ]converter"
141146
)/x, "$image_name: PHP has mbstring";
142-
ok $phpinfo =~ /PDO drivers => .*?mysql/, "$image_name: PHP has PDO mysql driver";
143-
ok $phpinfo =~ /GD Support => enabled/, "$image_name: PHP has GD";
147+
if ($image_name eq 'postgresql') {
148+
ok $phpinfo =~ /PDO drivers => .*?pgsql/, "$image_name: PHP has PDO pgsql driver";
149+
} else {
150+
ok $phpinfo =~ /PDO drivers => .*?mysql/, "$image_name: PHP has PDO mysql driver";
151+
}
152+
ok $phpinfo =~ /GD Support => enabled/, "$image_name: PHP has GD";
144153
SKIP: {
145154
local $TODO = 'php for CentOS6 does not support DOM/XML' if $image_name =~ /centos6/;
146-
ok $phpinfo =~ /DOM.XML => enabled/, "$image_name: PHP has DOM/XML";
155+
ok $phpinfo =~ /DOM.XML => enabled/, "$image_name: PHP has DOM/XML";
147156
}
148157
ok $phpinfo =~ /GIF Read Support => enabled/, "$image_name: PHP supports GIF read";
149158
ok $phpinfo =~ /GIF Create Support => enabled/, "$image_name: PHP supports GIF create";
150159
ok $phpinfo =~ /JPEG Support => enabled/, "$image_name: PHP supports JPEG";
151160
ok $phpinfo =~ /PNG Support => enabled/, "$image_name: PHP supports PNG";
152161
SKIP: {
153162
local $TODO = 'php for CentOS6 does not support WebP' if $image_name =~ /centos6/;
154-
ok $phpinfo =~ /WebP Support => enabled/, "$image_name: PHP supports WebP";
163+
ok $phpinfo =~ /WebP Support => enabled/, "$image_name: PHP supports WebP";
155164
}
156165
SKIP: {
157166
local $TODO = 'Memcache may not be supported' if $image_name =~ /amazonlinux|oracle|centos8/;
@@ -192,40 +201,45 @@ SKIP: {
192201
my ($phpunit) = (`phpunit --version` // '') =~ /PHPUnit (\d+\.\d+\.\d+)/;
193202
ok $phpunit, "$image_name: phpunit exists ($phpunit)";
194203
if ($php_version_number >= 8.2) {
195-
is substr($phpunit, 0, 2) => 11, "phpunit 11 (11.x.x) for php >= 8.2 ($php_version)";
204+
is substr($phpunit, 0, 2) => 11, "$image_name: phpunit 11 (11.x.x) for php >= 8.2 ($php_version)";
196205
} elsif ($php_version_number >= 8.1) {
197-
is substr($phpunit, 0, 2) => 10, "phpunit 10 (10.x.x) for php >= 8.1 ($php_version)";
206+
is substr($phpunit, 0, 2) => 10, "$image_name: phpunit 10 (10.x.x) for php >= 8.1 ($php_version)";
198207
} elsif ($php_version_number >= 7.3) {
199-
is substr($phpunit, 0, 1) => 9, "phpunit 9 (9.5.x) for php >= 7.3 ($php_version)";
208+
is substr($phpunit, 0, 1) => 9, "$image_name: phpunit 9 (9.5.x) for php >= 7.3 ($php_version)";
200209
} elsif ($php_version_number >= 7.2) {
201-
is substr($phpunit, 0, 1) => 8, "phpunit 8 (8.5.21) for php >= 7.2 ($php_version)";
210+
is substr($phpunit, 0, 1) => 8, "$image_name: phpunit 8 (8.5.21) for php >= 7.2 ($php_version)";
202211
} elsif ($php_version_number >= 7.1) {
203-
is substr($phpunit, 0, 1) => 7, "phpunit 7 (7.5.20) for php >= 7.1 ($php_version)";
212+
is substr($phpunit, 0, 1) => 7, "$image_name: phpunit 7 (7.5.20) for php >= 7.1 ($php_version)";
204213
} elsif ($php_version_number >= 7.0) {
205-
is substr($phpunit, 0, 1) => 6, "phpunit 6 (6.5.14) for php >= 7.0 ($php_version)";
214+
is substr($phpunit, 0, 1) => 6, "$image_name: phpunit 6 (6.5.14) for php >= 7.0 ($php_version)";
206215
} elsif ($php_version_number >= 5.6) {
207-
is substr($phpunit, 0, 1) => 5, "phpunit 5 (5.7.27) for php >= 5.6 ($php_version)";
216+
is substr($phpunit, 0, 1) => 5, "$image_name: phpunit 5 (5.7.27) for php >= 5.6 ($php_version)";
208217
} else {
209-
is substr($phpunit, 0, 1) => 4, "phpunit 4 (4.8.36) for php >= 5.3 ($php_version)";
218+
is substr($phpunit, 0, 1) => 4, "$image_name: phpunit 4 (4.8.36) for php >= 5.3 ($php_version)";
210219
}
211220
}
212221

213-
my ($mysql_version, $is_maria) = `mysql --verbose --help 2>/dev/null` =~ /mysql\s+(?:from|Ver).+?(\d+\.\d+\.\d+).+?(MariaDB)?/;
214-
my $mysql = $is_maria ? "MariaDB" : "MySQL";
215-
ok $mysql_version, "$image_name: $mysql exists ($mysql_version)";
216-
my $sql_mode = `mysql -Nse 'select \@\@sql_mode' 2>&1`;
217-
note "SQL mode: $sql_mode";
218-
if ($sql_mode =~ /Can't connect to local MySQL/) {
219-
fail "$image_name: failed to connect to local mysql" if $entrypoint_is_executed;
220-
}
221-
if ($mysql_version =~ /^5\.[567]\./ or $mysql_version =~ /^10\.[0123]\./) {
222-
my ($file_format) = `mysql -Nse 'select \@\@innodb_file_format'` =~ /(\w+)/;
223-
my ($file_per_table) = `mysql -Nse 'select \@\@innodb_file_per_table'` =~ /(\w+)/;
224-
my ($large_prefix) = `mysql -Nse 'select \@\@innodb_large_prefix'` =~ /(\w+)/;
225-
$file_format //= '';
226-
$file_per_table //= '';
227-
$large_prefix //= '';
228-
note "InnoDB: file format $file_format, file per table $file_per_table, large prefix $large_prefix";
222+
if ($image_name eq 'postgresql') {
223+
my ($postgresql_version) = `su -c 'postgres --version' postgres 2>/dev/null` =~ /postgres .+?(\d+\.\d+)/;
224+
ok $postgresql_version, "$image_name: postgresql exists ($postgresql_version)";
225+
} else {
226+
my ($mysql_version, $is_maria) = `mysql --verbose --help 2>/dev/null` =~ /mysql\s+(?:from|Ver).+?(\d+\.\d+\.\d+).+?(MariaDB)?/;
227+
my $mysql = $is_maria ? "MariaDB" : "MySQL";
228+
ok $mysql_version, "$image_name: $mysql exists ($mysql_version)";
229+
my $sql_mode = `mysql -Nse 'select \@\@sql_mode' 2>&1`;
230+
note "SQL mode: $sql_mode";
231+
if ($sql_mode =~ /Can't connect to local MySQL/) {
232+
fail "$image_name: failed to connect to local mysql" if $entrypoint_is_executed;
233+
}
234+
if ($mysql_version =~ /^5\.[567]\./ or $mysql_version =~ /^10\.[0123]\./) {
235+
my ($file_format) = `mysql -Nse 'select \@\@innodb_file_format'` =~ /(\w+)/;
236+
my ($file_per_table) = `mysql -Nse 'select \@\@innodb_file_per_table'` =~ /(\w+)/;
237+
my ($large_prefix) = `mysql -Nse 'select \@\@innodb_large_prefix'` =~ /(\w+)/;
238+
$file_format //= '';
239+
$file_per_table //= '';
240+
$large_prefix //= '';
241+
note "InnoDB: file format $file_format, file per table $file_per_table, large prefix $large_prefix";
242+
}
229243
}
230244

231245
my ($ruby_version) = `ruby --version 2>&1` =~ /ruby (\d+\.\d+.\d+)/;

bin/test_readme.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
next if $line =~ /^\|(?:\-|image name)/;
1111
$line =~ s/(^\|)|(\|$)//g;
1212
$line =~ s/\*//g;
13-
$line =~ s/MariaDB //;
13+
$line =~ s/(?:MariaDB|Postgres) //;
1414
my ($image, $base, @rest) = split '\|', $line;
1515
next if $image =~ /(?:openldap|chromedriver)/;
1616
if ($image =~ /(?:addons|chromiumdriver|playwright)/) {
@@ -42,7 +42,7 @@
4242
next;
4343
}
4444
my $wanted = $key;
45-
$wanted = '(?:mysql|mariadb)' if $key eq 'mysql';
45+
$wanted = '(?:mysql|mariadb|postgresql)' if $key eq 'mysql';
4646
my ($version) = $log =~ /$wanted exists \((.+?)\)/i;
4747
is $version => $mapping{$image}{$key} => "$image has correct $key";
4848
}

bin/update_dockerfile.pl

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
## fragile tests, or broken by other modules (Atom, Pulp)
3434
no_test => [qw( XMLRPC::Lite XML::Atom Net::Server Perl::Critic::Pulp Selenium::Remote::Driver )],
3535
## cf https://rt.cpan.org/Public/Bug/Display.html?id=130525
36-
## cf latest HTTP::Message itself is not broken but breaks HTML::Form
37-
## https://github.com/libwww-perl/HTML-Form/issues/50
3836
broken => [qw(
3937
Archive::Zip@1.65 DBD::mysql@4.050
40-
HTTP::Message@6.46
4138
)],
42-
extra => [qw( JSON::XS Starman Imager::File::WEBP Plack::Middleware::ReverseProxy )],
43-
addons => [qw(
39+
# Imager 1.026 breaks Imager::File::WEBP
40+
# cf. https://github.com/tonycoz/imager/issues/538
41+
temporary => [qw( Imager@1.025 )],
42+
extra => [qw( JSON::XS Starman Imager::File::WEBP Plack::Middleware::ReverseProxy )],
43+
addons => [qw(
4444
AnyEvent::FTP::Server Class::Method::Modifiers Capture::Tiny Moo File::chdir
4545
Net::LDAP Linux::Pid Data::Section::Simple
4646
)],
@@ -74,14 +74,14 @@
7474
## fragile tests, or broken by other modules (Atom, Pulp)
7575
no_test => [qw( XMLRPC::Lite XML::Atom Net::Server Perl::Critic::Pulp Selenium::Remote::Driver )],
7676
## cf https://rt.cpan.org/Public/Bug/Display.html?id=130525
77-
## cf latest HTTP::Message itself is not broken but breaks HTML::Form
78-
## https://github.com/libwww-perl/HTML-Form/issues/50
7977
broken => [qw(
8078
Archive::Zip@1.65 DBD::mysql@4.050
81-
HTTP::Message@6.46
8279
)],
83-
extra => [qw( JSON::XS Starman Imager::File::WEBP Plack::Middleware::ReverseProxy )],
84-
addons => [qw(
80+
# Imager 1.026 breaks Imager::File::WEBP
81+
# cf. https://github.com/tonycoz/imager/issues/538
82+
temporary => [qw( Imager@1.025 )],
83+
extra => [qw( JSON::XS Starman Imager::File::WEBP Plack::Middleware::ReverseProxy )],
84+
addons => [qw(
8585
AnyEvent::FTP::Server Class::Method::Modifiers Capture::Tiny Moo File::chdir
8686
Net::LDAP Linux::Pid Data::Section::Simple
8787
)],
@@ -888,6 +888,41 @@
888888
locale_def => 1,
889889
no_update => 1,
890890
},
891+
postgresql => {
892+
from => 'fedora:41',
893+
base => 'centos',
894+
yum => {
895+
_replace => {
896+
'mysql' => '',
897+
'mysql-server' => '',
898+
'mysql-devel' => '',
899+
'php-mysqlnd' => '',
900+
'procps' => 'perl-Unix-Process',
901+
'phpunit' => '',
902+
},
903+
db => [qw( postgresql postgresql-server libpq-devel )],
904+
base => [qw( distribution-gpg-keys glibc-langpack-en glibc-langpack-ja xz )],
905+
images => [qw( libomp-devel )],
906+
php => [qw( php-pgsql )],
907+
},
908+
cpan => {
909+
_replace => {
910+
'App::Prove::Plugin::MySQLPool' => '',
911+
'Test::mysqld' => '',
912+
'DBD::mysql@4.050' => '',
913+
},
914+
db => [qw( DBD::Pg Test::PostgreSQL )],
915+
},
916+
remove_from_cpanfile => [qw( DBD::mysql App::Prove::Plugin::MySQLPool )],
917+
make_dummy_cert => '/usr/bin',
918+
make => {
919+
# package is broken for unknown reason
920+
GraphicsMagick => '1.3.43',
921+
},
922+
patch => ['Crypt-DES-2.07'],
923+
installer => 'dnf',
924+
phpunit => 11,
925+
},
891926
);
892927

893928
my $templates = get_data_section();
@@ -1094,6 +1129,9 @@ sub load_prereqs {
10941129
<%= join " ", @{ $conf->{cpan}{$key} } %>\\
10951130
% }
10961131
&& curl -sLO https://raw.githubusercontent.com/movabletype/movabletype/develop/t/cpanfile &&\\
1132+
% if ($conf->{remove_from_cpanfile}) {
1133+
perl -i -nE 'print unless /(?:<%= join '|', @{$conf->{remove_from_cpanfile}} %>)/' cpanfile &&\\
1134+
% }
10971135
% if ($conf->{use_cpm}) {
10981136
cpm install -g --test --show-build-log-on-failure\\
10991137
% } else {
@@ -1195,7 +1233,7 @@ sub load_prereqs {
11951233
% }
11961234
% }
11971235
% if (!$conf->{no_update}) {
1198-
<%= $conf->{installer} // 'yum' %> -y <%= $conf->{nogpgcheck} ? '--nogpgcheck ' : '' %>update <% if ($type =~ /(rawhide|fedora4[1-9])/) { %>--skip-unavailable<% } elsif ($type ne 'fedora23') { %>--skip-broken<% } %><% if ($conf->{no_best}) { %> --nobest<% } %> &&\\
1236+
<%= $conf->{installer} // 'yum' %> -y <%= $conf->{nogpgcheck} ? '--nogpgcheck ' : '' %>update <% if ($type =~ /(rawhide|fedora4[1-9]|postgresql)/) { %>--skip-unavailable<% } elsif ($type ne 'fedora23') { %>--skip-broken<% } %><% if ($conf->{no_best}) { %> --nobest<% } %> &&\\
11991237
% }
12001238
<%= $conf->{installer} // 'yum' %> clean all && rm -rf /var/cache/<%= $conf->{installer} // 'yum' %> &&\\
12011239
% if ($conf->{use_legacy_policies}) {
@@ -1272,6 +1310,9 @@ sub load_prereqs {
12721310
<%= join " ", @{ $conf->{cpan}{$key} } %>\\
12731311
% }
12741312
&& curl -sLO https://raw.githubusercontent.com/movabletype/movabletype/develop/t/cpanfile &&\\
1313+
% if ($conf->{remove_from_cpanfile}) {
1314+
perl -i -nE 'print unless /(?:<%= join '|', @{$conf->{remove_from_cpanfile}} %>)/' cpanfile &&\\
1315+
% }
12751316
% if ($conf->{use_cpm}) {
12761317
cpm install -g --test --show-build-log-on-failure &&\\
12771318
% } else {
@@ -1345,6 +1386,9 @@ sub load_prereqs {
13451386
mysql -e "grant all privileges on mt_test.* to mt@localhost;"
13461387
13471388
if [ -f t/cpanfile ]; then
1389+
% if ($conf->{remove_from_cpanfile}) {
1390+
perl -i -nE 'print unless /(?:<%= join '|', @{$conf->{remove_from_cpanfile}} %>)/' t/cpanfile &&\\
1391+
% }
13481392
<%= $conf->{cpanm} %> --installdeps -n . --cpanfile=t/cpanfile
13491393
fi
13501394
@@ -1398,19 +1442,39 @@ sub load_prereqs {
13981442
13991443
% if ($type eq 'centos6') {
14001444
mysql -e "create database if not exists mt_test character set utf8;"
1401-
% } else {
1445+
% } elsif ($type ne 'postgresql') {
14021446
mysql -e "create database mt_test character set utf8;"
14031447
% }
1448+
% if ($type eq 'postgresql') {
1449+
export PGDATA=/var/lib/postgresql/data
1450+
install --verbose --directory --owner postgres --group postgres --mode 1777 /var/lib/postgresql
1451+
install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql
1452+
1453+
su -c 'initdb --show' postgres
1454+
1455+
su -c 'pg_ctl -D /var/lib/postgresql/data start' postgres
1456+
1457+
su -c 'createuser mt' postgres
1458+
su -c 'createdb -O mt mt_test' postgres
1459+
% } else {
14041460
% if ($type ne 'centos6') {
14051461
mysql -e "create user mt@localhost;"
14061462
% }
14071463
mysql -e "grant all privileges on mt_test.* to mt@localhost;"
1464+
% }
14081465
14091466
memcached -d -u root
14101467
14111468
if [ -f t/cpanfile ]; then
1469+
% if ($conf->{remove_from_cpanfile}) {
1470+
perl -i -nE 'print unless /(?:<%= join '|', @{$conf->{remove_from_cpanfile}} %>)/' t/cpanfile &&\\
1471+
% }
14121472
<%= $conf->{cpanm} %> --installdeps -n . --cpanfile=t/cpanfile
14131473
fi
14141474
1475+
% if ($type eq 'postgresql') {
1476+
export MT_TEST_BACKEND=Pg
1477+
% }
1478+
14151479
exec "$@"
14161480

postgresql/Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
FROM fedora:41
2+
3+
WORKDIR /root
4+
5+
COPY ./patch/ /root/patch/
6+
7+
RUN dnf -y install\
8+
distribution-gpg-keys glibc-langpack-en glibc-langpack-ja xz git make cmake gcc clang curl perl perl-core tar zip unzip bzip2 which perl-Unix-Process postfix\
9+
postgresql postgresql-server libpq-devel\
10+
vim nano\
11+
libomp-devel ImageMagick-perl perl-GD GraphicsMagick-perl netpbm-progs ImageMagick GraphicsMagick giflib-devel libpng-devel libjpeg-devel gd-devel libwebp-devel icc-profiles-openicc\
12+
libxml2-devel expat-devel openssl-devel openssl gmp-devel\
13+
php-pgsql php php-gd php-mbstring php-pecl-memcache\
14+
ruby ruby-devel\
15+
mod_ssl vsftpd ftp memcached\
16+
&&\
17+
dnf -y update --skip-unavailable &&\
18+
dnf clean all && rm -rf /var/cache/dnf &&\
19+
mkdir src && cd src &&\
20+
curl -LO https://sourceforge.net/projects/graphicsmagick/files/graphicsmagick/1.3.43/GraphicsMagick-1.3.43.tar.xz &&\
21+
tar xf GraphicsMagick-1.3.43.tar.xz && cd GraphicsMagick-1.3.43 &&\
22+
./configure --prefix=/usr --enable-shared --with-perl --disable-opencl --disable-dependency-tracking --without-x --without-ttf --without-wmf --without-magick-plus-plus --without-bzlib --without-zlib --without-dps --without-fpx --without-jpig --without-lcms2 --without-lzma --without-xml --without-gs --with-quantum-depth=16 && make && make install && cd PerlMagick && perl Makefile.PL && make install && cd ../.. &&\
23+
cd .. && rm -rf src && ldconfig /usr/local/lib &&\
24+
curl -sL https://phar.phpunit.de/phpunit-11.phar > phpunit && chmod +x phpunit &&\
25+
mv phpunit /usr/local/bin/ &&\
26+
(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | bash) &&\
27+
gem install \
28+
fluentd\
29+
&&\
30+
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 &&\
31+
curl -sL --compressed https://git.io/cpm > cpm &&\
32+
chmod +x cpm &&\
33+
mv cpm /usr/local/bin/ &&\
34+
cpanm -v Imager@1.025 &&\
35+
cpanm -n XMLRPC::Lite XML::Atom Net::Server Perl::Critic::Pulp Selenium::Remote::Driver &&\
36+
cpanm -v Archive::Zip@1.65 &&\
37+
cd /root/patch/Crypt-DES-2.07 && cpanm --installdeps . && cpanm . && cd /root &&\
38+
rm -rf /root/patch &&\
39+
cpanm -v \
40+
AnyEvent::FTP::Server Class::Method::Modifiers Capture::Tiny Moo File::chdir Net::LDAP Linux::Pid Data::Section::Simple\
41+
pQuery\
42+
DBD::Pg Test::PostgreSQL\
43+
JSON::XS Starman Imager::File::WEBP Plack::Middleware::ReverseProxy\
44+
JavaScript::Minifier CSS::Minifier\
45+
Fluent::Logger\
46+
&& curl -sLO https://raw.githubusercontent.com/movabletype/movabletype/develop/t/cpanfile &&\
47+
perl -i -nE 'print unless /(?:DBD::mysql|App::Prove::Plugin::MySQLPool)/' cpanfile &&\
48+
cpanm --installdeps -v . &&\
49+
rm -rf cpanfile /root/.perl-cpm /root/.cpanm /root/.qws
50+
51+
ENV LANG=en_US.UTF-8 \
52+
LC_ALL=en_US.UTF-8
53+
54+
RUN set -ex &&\
55+
perl -i -pe \
56+
's!AllowOverride None!AllowOverride All!g; s!#AddEncoding x-gzip \.gz \.tgz!AddEncoding x-gzip .gz .tgz .svgz!g;' \
57+
/etc/httpd/conf/httpd.conf &&\
58+
perl -e 'my ($inifile) = `php --ini` =~ m!Loaded Configuration File:\s+(/\S+/php.ini)!; \
59+
my $ini = do { open my $fh, "<", $inifile; local $/; <$fh> }; \
60+
$ini =~ s!^;\s*date\.timezone =!date\.timezone = "Asia/Tokyo"!m; \
61+
open my $fh, ">", $inifile; print $fh $ini' &&\
62+
sed -i -E 's/inet_protocols = all/inet_protocols = ipv4/' /etc/postfix/main.cf
63+
64+
RUN cd /usr/bin && ./make-dummy-cert /etc/pki/tls/certs/localhost.crt &&\
65+
perl -i -pe 's!SSLCertificateKeyFile /etc/pki/tls/private/localhost.key!!' \
66+
/etc/httpd/conf.d/ssl.conf && cd $WORKDIR
67+
68+
COPY ./docker-entrypoint.sh /
69+
ENTRYPOINT ["/docker-entrypoint.sh"]

0 commit comments

Comments
 (0)