Skip to content

Commit 91a9cd7

Browse files
author
MySQL Build Team
committed
Release version 1.2.19-server
* ET#82635: Bump versions for October 8.0.40/8.4.3/9.1.0 Docker releases * ET#82573 please create 9.2 container images * ET#82116 container images are wrong version for 8.0 and 8.4
1 parent 7ed3627 commit 91a9cd7

11 files changed

+356
-12
lines changed

mysql-server/8.0/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
FROM container-registry.oracle.com/os/oraclelinux:9-slim
1717

18-
ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.39
19-
ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.38
18+
ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.0.40
19+
ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.0.40
2020

2121
# Setup repositories for minimal packages (all versions)
2222
RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \

mysql-server/8.0/docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1616
set -e
1717

18-
echo "[Entrypoint] MySQL Docker Image 8.0.39-1.2.18-server"
18+
echo "[Entrypoint] MySQL Docker Image 8.0.40-1.2.19-server"
1919
# Fetch value from server config
2020
# We use mysqld --verbose --help instead of my_print_defaults because the
2121
# latter only show values present in config files, and not server defaults
@@ -220,7 +220,7 @@ EOF
220220
echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..."
221221
exit 0
222222
else
223-
echo "[Entrypoint] Starting MySQL 8.0.39-1.2.18-server"
223+
echo "[Entrypoint] Starting MySQL 8.0.40-1.2.19-server"
224224
fi
225225
# 4th value of /proc/$pid/stat is the ppid, same as getppid()
226226
export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4)

mysql-server/8.0/inspec/control.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
impact 0.5
1212
describe package('mysql-community-server-minimal') do
1313
it { should be_installed }
14-
its ('version') { should match '8.0.39.*' }
14+
its ('version') { should match '8.0.40.*' }
1515
end
1616
describe package('mysql-shell') do
1717
it { should be_installed }
18-
its ('version') { should match '8.0.38.*' }
18+
its ('version') { should match '8.0.40.*' }
1919
end
2020
end

mysql-server/8.4/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
FROM container-registry.oracle.com/os/oraclelinux:9-slim
1717

18-
ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.2
19-
ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.1
18+
ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-8.4.3
19+
ARG MYSQL_SHELL_PACKAGE=mysql-shell-8.4.3
2020

2121
# Setup repositories for minimal packages (all versions)
2222
RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \

mysql-server/8.4/docker-entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1616
set -e
1717

18-
echo "[Entrypoint] MySQL Docker Image 8.4.2-1.2.18-server"
18+
echo "[Entrypoint] MySQL Docker Image 8.4.3-1.2.19-server"
1919
# Fetch value from server config
2020
# We use mysqld --verbose --help instead of my_print_defaults because the
2121
# latter only show values present in config files, and not server defaults
@@ -220,7 +220,7 @@ EOF
220220
echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..."
221221
exit 0
222222
else
223-
echo "[Entrypoint] Starting MySQL 8.4.2-1.2.18-server"
223+
echo "[Entrypoint] Starting MySQL 8.4.3-1.2.19-server"
224224
fi
225225
# 4th value of /proc/$pid/stat is the ppid, same as getppid()
226226
export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4)

mysql-server/8.4/inspec/control.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
impact 0.5
1212
describe package('mysql-community-server-minimal') do
1313
it { should be_installed }
14-
its ('version') { should match '8.4.2.*' }
14+
its ('version') { should match '8.4.3.*' }
1515
end
1616
describe package('mysql-shell') do
1717
it { should be_installed }
18-
its ('version') { should match '8.4.1.*' }
18+
its ('version') { should match '8.4.3.*' }
1919
end
2020
end

mysql-server/9.1/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) 2017, 2023, Oracle and/or its affiliates.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
FROM container-registry.oracle.com/os/oraclelinux:9-slim
17+
18+
ARG MYSQL_SERVER_PACKAGE=mysql-community-server-minimal-9.1.0
19+
ARG MYSQL_SHELL_PACKAGE=mysql-shell-9.1.0
20+
21+
# Setup repositories for minimal packages (all versions)
22+
RUN rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql-community-minimal-release-el9.rpm \
23+
&& rpm -U http://repo.mysql.oraclecorp.com/mysql-uat/repos-stage/mysql84-community-release-el9.rpm
24+
25+
# Install server and shell 8.0
26+
RUN microdnf update && echo "[main]" > /etc/dnf/dnf.conf \
27+
&& microdnf install -y --enablerepo=mysql-tools-innovation-community $MYSQL_SHELL_PACKAGE \
28+
&& microdnf install -y --disablerepo=ol9_appstream \
29+
--enablerepo=mysql-innovation-community-minimal $MYSQL_SERVER_PACKAGE \
30+
&& microdnf remove -y mysql-community-minimal-release mysql84-community-release \
31+
&& microdnf clean all \
32+
&& mkdir /docker-entrypoint-initdb.d
33+
34+
COPY prepare-image.sh /
35+
RUN /prepare-image.sh && rm -f /prepare-image.sh
36+
37+
ENV MYSQL_UNIX_PORT /var/lib/mysql/mysql.sock
38+
39+
COPY docker-entrypoint.sh /entrypoint.sh
40+
COPY healthcheck.sh /healthcheck.sh
41+
ENTRYPOINT ["/entrypoint.sh"]
42+
HEALTHCHECK CMD /healthcheck.sh
43+
EXPOSE 3306 33060 33061
44+
CMD ["mysqld"]
45+

mysql-server/9.1/docker-entrypoint.sh

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
#!/bin/bash
2+
# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
3+
#
4+
# This program is free software; you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation; version 2 of the License.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
set -e
17+
18+
echo "[Entrypoint] MySQL Docker Image 9.1.0-1.2.19-server"
19+
# Fetch value from server config
20+
# We use mysqld --verbose --help instead of my_print_defaults because the
21+
# latter only show values present in config files, and not server defaults
22+
_get_config() {
23+
local conf="$1"; shift
24+
"$@" --verbose --help 2>/dev/null | grep "^$conf" | awk '$1 == "'"$conf"'" { print $2; exit }'
25+
}
26+
27+
# Generate a random password
28+
_mkpw() {
29+
letter=$(cat /dev/urandom| tr -dc a-zA-Z | dd bs=1 count=16 2> /dev/null )
30+
number=$(cat /dev/urandom| tr -dc 0-9 | dd bs=1 count=8 2> /dev/null)
31+
special=$(cat /dev/urandom| tr -dc '=+@#%^&*_.,;:?/' | dd bs=1 count=8 2> /dev/null)
32+
33+
echo $letter$number$special | fold -w 1 | shuf | tr -d '\n'
34+
}
35+
36+
# If command starts with an option, prepend mysqld
37+
# This allows users to add command-line options without
38+
# needing to specify the "mysqld" command
39+
if [ "${1:0:1}" = '-' ]; then
40+
set -- mysqld "$@"
41+
fi
42+
43+
# Check if entrypoint (and the container) is running as root
44+
if [ $(id -u) = "0" ]; then
45+
is_root=1
46+
install_devnull="install /dev/null -m0600 -omysql -gmysql"
47+
MYSQLD_USER=mysql
48+
else
49+
install_devnull="install /dev/null -m0600"
50+
MYSQLD_USER=$(id -u)
51+
fi
52+
53+
if [ "$1" = 'mysqld' ]; then
54+
# Test that the server can start. We redirect stdout to /dev/null so
55+
# only the error messages are left.
56+
result=0
57+
output=$("$@" --validate-config) || result=$?
58+
if [ ! "$result" = "0" ]; then
59+
echo >&2 '[Entrypoint] ERROR: Unable to start MySQL. Please check your configuration.'
60+
echo >&2 "[Entrypoint] $output"
61+
exit 1
62+
fi
63+
64+
# Get config
65+
DATADIR="$(_get_config 'datadir' "$@")"
66+
SOCKET="$(_get_config 'socket' "$@")"
67+
68+
if [ ! -d "$DATADIR/mysql" ]; then
69+
# If the password variable is a filename we use the contents of the file. We
70+
# read this first to make sure that a proper error is generated for empty files.
71+
if [ -f "$MYSQL_ROOT_PASSWORD" ]; then
72+
MYSQL_ROOT_PASSWORD="$(cat $MYSQL_ROOT_PASSWORD)"
73+
if [ -z "$MYSQL_ROOT_PASSWORD" ]; then
74+
echo >&2 '[Entrypoint] Empty MYSQL_ROOT_PASSWORD file specified.'
75+
exit 1
76+
fi
77+
fi
78+
if [ -z "$MYSQL_ROOT_PASSWORD" -a -z "$MYSQL_ALLOW_EMPTY_PASSWORD" -a -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then
79+
echo >&2 '[Entrypoint] No password option specified for new database.'
80+
echo >&2 '[Entrypoint] A random onetime password will be generated.'
81+
MYSQL_RANDOM_ROOT_PASSWORD=true
82+
MYSQL_ONETIME_PASSWORD=true
83+
fi
84+
if [ ! -d "$DATADIR" ]; then
85+
mkdir -p "$DATADIR"
86+
chown mysql:mysql "$DATADIR"
87+
fi
88+
89+
# The user can set a default_timezone either in a my.cnf file
90+
# they mount into the container or on command line
91+
# (`docker run mysql/mysql-server:8.0 --default-time-zone=Europe/Berlin`)
92+
# however the timezone tables will only be populated in a later
93+
# stage of this script. By using +00:00 as timezone we override
94+
# the user's choice during initialization. Later the server
95+
# will be restarted using the user's option.
96+
97+
echo '[Entrypoint] Initializing database'
98+
"$@" --user=$MYSQLD_USER --initialize-insecure --default-time-zone=+00:00
99+
100+
echo '[Entrypoint] Database initialized'
101+
"$@" --user=$MYSQLD_USER --daemonize --skip-networking --socket="$SOCKET" --default-time-zone=+00:00
102+
103+
# To avoid using password on commandline, put it in a temporary file.
104+
# The file is only populated when and if the root password is set.
105+
PASSFILE=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX)
106+
$install_devnull "$PASSFILE"
107+
# Define the client command used throughout the script
108+
# "SET @@SESSION.SQL_LOG_BIN=0;" is required for products like group replication to work properly
109+
mysql=( mysql --defaults-extra-file="$PASSFILE" --protocol=socket -uroot -hlocalhost --socket="$SOCKET" --init-command="SET @@SESSION.SQL_LOG_BIN=0;")
110+
111+
for i in {30..0}; do
112+
if mysqladmin --socket="$SOCKET" ping &>/dev/null; then
113+
break
114+
fi
115+
echo '[Entrypoint] Waiting for server...'
116+
sleep 1
117+
done
118+
if [ "$i" = 0 ]; then
119+
echo >&2 '[Entrypoint] Timeout during MySQL init.'
120+
exit 1
121+
fi
122+
123+
mysql_tzinfo_to_sql /usr/share/zoneinfo | "${mysql[@]}" mysql
124+
125+
if [ ! -z "$MYSQL_RANDOM_ROOT_PASSWORD" ]; then
126+
MYSQL_ROOT_PASSWORD="$(_mkpw)"
127+
echo "[Entrypoint] GENERATED ROOT PASSWORD: $MYSQL_ROOT_PASSWORD"
128+
fi
129+
if [ -z "$MYSQL_ROOT_HOST" ]; then
130+
ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}';"
131+
else
132+
ROOTCREATE="ALTER USER 'root'@'localhost' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \
133+
CREATE USER 'root'@'${MYSQL_ROOT_HOST}' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}'; \
134+
GRANT ALL ON *.* TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ; \
135+
GRANT PROXY ON ''@'' TO 'root'@'${MYSQL_ROOT_HOST}' WITH GRANT OPTION ;"
136+
fi
137+
"${mysql[@]}" <<-EOSQL
138+
DELETE FROM mysql.user WHERE user NOT IN ('mysql.infoschema', 'mysql.session', 'mysql.sys', 'root') OR host NOT IN ('localhost');
139+
CREATE USER 'healthchecker'@'localhost' IDENTIFIED BY 'healthcheckpass';
140+
${ROOTCREATE}
141+
FLUSH PRIVILEGES ;
142+
EOSQL
143+
if [ ! -z "$MYSQL_ROOT_PASSWORD" ]; then
144+
# Put the password into the temporary config file
145+
cat >"$PASSFILE" <<EOF
146+
[client]
147+
password="${MYSQL_ROOT_PASSWORD}"
148+
EOF
149+
#mysql+=( -p"${MYSQL_ROOT_PASSWORD}" )
150+
fi
151+
152+
if [ "$MYSQL_DATABASE" ]; then
153+
echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` ;" | "${mysql[@]}"
154+
mysql+=( "$MYSQL_DATABASE" )
155+
fi
156+
157+
if [ "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then
158+
echo "CREATE USER '"$MYSQL_USER"'@'%' IDENTIFIED BY '"$MYSQL_PASSWORD"' ;" | "${mysql[@]}"
159+
160+
if [ "$MYSQL_DATABASE" ]; then
161+
echo "GRANT ALL ON \`"$MYSQL_DATABASE"\`.* TO '"$MYSQL_USER"'@'%' ;" | "${mysql[@]}"
162+
fi
163+
164+
elif [ "$MYSQL_USER" -a ! "$MYSQL_PASSWORD" -o ! "$MYSQL_USER" -a "$MYSQL_PASSWORD" ]; then
165+
echo '[Entrypoint] Not creating mysql user. MYSQL_USER and MYSQL_PASSWORD must be specified to create a mysql user.'
166+
fi
167+
echo
168+
for f in /docker-entrypoint-initdb.d/*; do
169+
case "$f" in
170+
*.sh) echo "[Entrypoint] running $f"; . "$f" ;;
171+
*.sql) echo "[Entrypoint] running $f"; "${mysql[@]}" < "$f" && echo ;;
172+
*) echo "[Entrypoint] ignoring $f" ;;
173+
esac
174+
echo
175+
done
176+
177+
# When using a local socket, mysqladmin shutdown will only complete when the server is actually down
178+
mysqladmin --defaults-extra-file="$PASSFILE" shutdown -uroot --socket="$SOCKET"
179+
rm -f "$PASSFILE"
180+
unset PASSFILE
181+
echo "[Entrypoint] Server shut down"
182+
183+
# This needs to be done outside the normal init, since mysqladmin shutdown will not work after
184+
if [ ! -z "$MYSQL_ONETIME_PASSWORD" ]; then
185+
echo "[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used."
186+
SQL=$(mktemp -u /var/lib/mysql-files/XXXXXXXXXX)
187+
$install_devnull "$SQL"
188+
if [ ! -z "$MYSQL_ROOT_HOST" ]; then
189+
cat << EOF > "$SQL"
190+
ALTER USER 'root'@'${MYSQL_ROOT_HOST}' PASSWORD EXPIRE;
191+
ALTER USER 'root'@'localhost' PASSWORD EXPIRE;
192+
EOF
193+
else
194+
cat << EOF > "$SQL"
195+
ALTER USER 'root'@'localhost' PASSWORD EXPIRE;
196+
EOF
197+
fi
198+
set -- "$@" --init-file="$SQL"
199+
unset SQL
200+
fi
201+
202+
echo
203+
echo '[Entrypoint] MySQL init process done. Ready for start up.'
204+
echo
205+
fi
206+
207+
# Used by healthcheck to make sure it doesn't mistakenly report container
208+
# healthy during startup
209+
# Put the password into the temporary config file
210+
touch /var/lib/mysql-files/healthcheck.cnf
211+
cat >"/var/lib/mysql-files/healthcheck.cnf" <<EOF
212+
[client]
213+
user=healthchecker
214+
socket=${SOCKET}
215+
password=healthcheckpass
216+
EOF
217+
touch /var/lib/mysql-files/mysql-init-complete
218+
219+
if [ -n "$MYSQL_INITIALIZE_ONLY" ]; then
220+
echo "[Entrypoint] MYSQL_INITIALIZE_ONLY is set, exiting without starting MySQL..."
221+
exit 0
222+
else
223+
echo "[Entrypoint] Starting MySQL 9.1.0-1.2.19-server"
224+
fi
225+
# 4th value of /proc/$pid/stat is the ppid, same as getppid()
226+
export MYSQLD_PARENT_PID=$(cat /proc/$$/stat|cut -d\ -f4)
227+
exec "$@" --user=$MYSQLD_USER
228+
else
229+
exec "$@"
230+
fi

mysql-server/9.1/healthcheck.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# Copyright (c) 2017, 2021, Oracle and/or its affiliates.
3+
#
4+
# This program is free software; you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation; version 2 of the License.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
17+
# The mysql-init-complete file is touched by the entrypoint file before the
18+
# main server process is started
19+
if [ -f /var/lib/mysql-files/mysql-init-complete ]; # The entrypoint script touches this file
20+
then # Ping server to see if it is ready
21+
mysqladmin --defaults-extra-file=/var/lib/mysql-files/healthcheck.cnf ping
22+
else # Initialization still in progress
23+
exit 1
24+
fi

0 commit comments

Comments
 (0)