Skip to content

Commit

Permalink
Merge pull request #125 from movabletype/mysql84
Browse files Browse the repository at this point in the history
Mysql84
  • Loading branch information
charsbar authored Nov 18, 2024
2 parents fefeeb8 + ed09f35 commit f0b58c3
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Dockerfile to test MT.
|fedora37|fedora:37|*5.36.1*|*8.1.25*|8.0.35|3.0.9|-|
|fedora39|fedora:39|5.38.2|*8.2.24*|8.0.39|3.1.4|-|
|fedora40|fedora:40|*5.38.2*|8.3.12|*8.0.39*|3.2.2|-|
|fedora41|fedora:41|*5.40.0*|*8.3.12*|*8.0.39*|3.2.2|-|
|fedora41|fedora:41|*5.40.0*|*8.3.13*|*8.4.3*|3.2.2|-|
|cloud6 (\*1)|centos:7|*5.28.2*|*7.4.33*|*5.7.44*|1.0.2k|-|
|cloud7 (\*1)|rockylinux:9|5.38.2|8.2.24|MariaDB 10.5.22|3.0.7|-|

Expand All @@ -33,6 +33,7 @@ Dockerfile to test MT.
|rockylinux|rockylinux:9|5.32.1|8.1.30|8.0.36|3.0.7|-|
|bookworm|debian:bookworm|5.36.0|8.2.24|*MariaDB 10.11.6*|3.0.14|-|
|sid|debian:sid|5.40.0|8.2.24|MariaDB 11.4.3|3.3.2|-|
|noble|ubuntu:noble|5.38.2|8.3.6|8.4.3|3.0.13|-|
|amazonlinux|amazonlinux:2|5.16.3|7.4.33|MariaDB 5.5.68|1.0.2k|-|
|amazonlinux2022 (\*4)|amazonlinux:2023|5.32.1|8.3.7|MariaDB 10.5.25|3.0.8|-|
|oracle8 (\*3)|oraclelinux:8|5.26.3|8.2.24|MariaDB 10.3.39|1.1.1k|-|
Expand Down
48 changes: 45 additions & 3 deletions bin/update_dockerfile.pl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Data::Section::Simple qw/get_data_section/;
use Mojo::Template;
use Mojo::File qw/path/;
use File::Basename;

my $ruby_version = '3.1.4';

Expand Down Expand Up @@ -161,6 +162,22 @@
},
phpunit => 9,
},
noble => {
from => 'ubuntu:noble',
base => 'debian',
apt => {
php => [qw( php-mbstring php-xml )],
},
repo => {
# taken from https://dev.mysql.com/downloads/repo/apt/
mysql84 => 'https://dev.mysql.com/get/mysql-apt-config_0.8.33-1_all.deb',
},
cpan => {
no_test => [qw(GD)],
},
patch => ['Test-mysqld-1.0020'],
phpunit => 9,
},
rawhide => {
from => 'fedora:rawhide',
base => 'centos',
Expand Down Expand Up @@ -213,9 +230,15 @@
# package is broken for unknown reason
GraphicsMagick => '1.3.43',
},
repo => {
mysql84 => [qw(mysql-community-server mysql-community-client mysql-community-libs-compat mysql-community-libs mysql-community-devel)],
},
mysql84 => {
rpm => 'https://dev.mysql.com/get/mysql84-community-release-fc40-1.noarch.rpm',
enable => 'mysql-8.4-lts-community',
},
patch => ['Imager-1.024', 'Test-mysqld-1.0020'],
installer => 'dnf',
setcap => 1,
phpunit => 9,
},
fedora40 => {
Expand Down Expand Up @@ -981,13 +1004,24 @@ sub load_prereqs {
% if ($conf->{patch}) {
COPY ./patch/ /root/patch/
% }
% }
RUN \\
% if ($conf->{use_archive}) {
sed -i -E 's/deb.debian.org/archive.debian.org/' /etc/apt/sources.list &&\\
sed -i -E 's/security.debian.org/archive.debian.org/' /etc/apt/sources.list &&\\
sed -i -E 's/^.+\-updates.+//' /etc/apt/sources.list &&\\
% }
% if ($conf->{repo}) {
apt-get update &&\\
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes\\
apt-get --no-install-recommends -y install curl wget gnupg ca-certificates lsb-release &&\\
% for my $key (keys %{$conf->{repo}}) {
% my $deb = $conf->{repo}{$key};
curl -LO <%= $deb %> &&\\
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes dpkg -i <%= File::Basename::basename($deb) %> &&\\
rm <%= File::Basename::basename($deb) %> &&\\
% }
% }
apt-get update &&\\
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes\\
Expand Down Expand Up @@ -1282,7 +1316,15 @@ sub load_prereqs {
% } elsif ($type =~ /^(?:buster|jessie)$/) {
chown -R mysql:mysql /var/lib/mysql
% }
% if ($type =~ /sid|bookworm|bullseye/) {
% if ($conf->{repo}{mysql84}) {
bash -c "cd /usr; mysqld --datadir='/var/lib/mysql' --user=mysql &"
sleep 1
until mysqladmin ping -h localhost --silent; do
echo 'waiting for mysqld to be connectable...'
sleep 1
done
% } elsif ($type =~ /sid|bookworm|bullseye/) {
service mariadb start
% } else {
service mysql start
Expand Down
77 changes: 77 additions & 0 deletions noble/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FROM ubuntu:noble

WORKDIR /root

COPY ./patch/ /root/patch/

RUN \
apt-get update &&\
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes\
apt-get --no-install-recommends -y install curl wget gnupg ca-certificates lsb-release &&\
curl -LO https://dev.mysql.com/get/mysql-apt-config_0.8.33-1_all.deb &&\
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes dpkg -i mysql-apt-config_0.8.33-1_all.deb &&\
rm mysql-apt-config_0.8.33-1_all.deb &&\
apt-get update &&\
DEBIAN_FRONTEND=noninteractive DEBCONF_NOWARNINGS=yes\
apt-get --no-install-recommends -y install\
ca-certificates netbase git make cmake gcc clang curl ssh locales perl zip unzip bzip2 procps ssl-cert postfix\
mysql-server mysql-client libmysqlclient-dev\
vim nano\
perlmagick libgraphics-magick-perl netpbm imagemagick graphicsmagick libgd-dev libpng-dev libgif-dev libjpeg-dev libwebp-dev icc-profiles-free\
libxml2-dev libgmp-dev libssl-dev\
php-mbstring php-xml php php-cli php-mysqlnd php-gd php-memcache phpunit\
ruby ruby-dev\
apache2 vsftpd ftp memcached\
&& apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* &&\
ln -s /usr/sbin/apache2 /usr/sbin/httpd &&\
curl -sL https://phar.phpunit.de/phpunit-9.phar > phpunit && chmod +x phpunit &&\
mv phpunit /usr/local/bin/ &&\
(curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | bash) &&\
gem install \
fluentd\
&&\
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 &&\
curl -sL --compressed https://git.io/cpm > cpm &&\
chmod +x cpm &&\
mv cpm /usr/local/bin/ &&\
cpm install -g --show-build-log-on-failure GD XMLRPC::Lite XML::Atom Net::Server Perl::Critic::Pulp Selenium::Remote::Driver &&\
cpm install -g --test --show-build-log-on-failure Archive::[email protected] DBD::[email protected] HTTP::[email protected] &&\
cd /root/patch/Test-mysqld-1.0020 && cpanm --installdeps . && cpanm . && cd /root &&\
rm -rf /root/patch &&\
cpanm -v \
pQuery\
JSON::XS Starman Imager::File::WEBP Plack::Middleware::ReverseProxy\
JavaScript::Minifier CSS::Minifier\
Fluent::Logger\
&& curl -sLO https://raw.githubusercontent.com/movabletype/movabletype/develop/t/cpanfile &&\
cpanm -v --installdeps . \
&& rm -rf cpanfile /root/.perl-cpm/ /root/.cpanm /root/.qws

RUN set -ex &&\
localedef -i en_US -f UTF-8 en_US.UTF-8 &&\
localedef -i ja_JP -f UTF-8 ja_JP.UTF-8 &&\
a2dismod mpm_event &&\
a2enmod mpm_prefork cgi rewrite proxy proxy_http ssl &&\
a2enconf serve-cgi-bin &&\
a2ensite default-ssl &&\
make-ssl-cert generate-default-snakeoil &&\
find /etc/apache2/ | grep '\.conf' | xargs perl -i -pe \
's!AllowOverride None!AllowOverride All!g; s!/usr/lib/cgi-bin!/var/www/cgi-bin!g; s!#AddEncoding x-gzip \.gz \.tgz!AddEncoding x-gzip .gz .tgz .svgz!g;' &&\
perl -e 'my ($inifile) = `php --ini` =~ m!Loaded Configuration File:\s+(/\S+/php.ini)!; \
my $ini = do { open my $fh, "<", $inifile or die $!; local $/; <$fh> }; \
$ini =~ s!^;\s*date\.timezone =!date\.timezone = "Asia/Tokyo"!m; \
open my $fh, ">", $inifile or die $!; print $fh $ini'


ENV LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
APACHE_RUN_DIR=/var/run/apache2 \
APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
APACHE_LOG_DIR=/var/log/apache2 \
APACHE_PID_FILE=/var/run/apache2.pid \
APACHE_LOCK_DIR=/var/lock/apache2 \
APACHE_CONF_DIR=/etc/apache2

COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
21 changes: 21 additions & 0 deletions noble/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -e

bash -c "cd /usr; mysqld --datadir='/var/lib/mysql' --user=mysql &"

sleep 1
until mysqladmin ping -h localhost --silent; do
echo 'waiting for mysqld to be connectable...'
sleep 1
done
service memcached start

mysql -e "create database mt_test character set utf8;"
mysql -e "create user mt@localhost;"
mysql -e "grant all privileges on mt_test.* to mt@localhost;"

if [ -f t/cpanfile ]; then
cpanm --installdeps -n . --cpanfile=t/cpanfile
fi

exec "$@"

0 comments on commit f0b58c3

Please sign in to comment.