File tree Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Expand file tree Collapse file tree 4 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,18 @@ RUN set -x \
1919
2020RUN mkdir /docker-entrypoint-initdb.d
2121
22+ RUN apt-get update && apt-get install -y --no-install-recommends \
23+ # for MYSQL_RANDOM_ROOT_PASSWORD
24+ pwgen \
25+ # for mysql_ssl_rsa_setup
26+ openssl \
2227# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db:
2328# File::Basename
2429# File::Copy
2530# Sys::Hostname
2631# Data::Dumper
27- RUN apt-get update && apt-get install -y perl pwgen --no-install-recommends && rm -rf /var/lib/apt/lists/*
32+ perl \
33+ && rm -rf /var/lib/apt/lists/*
2834
2935RUN set -ex; \
3036# gpg: key 5072E1F5: public key "MySQL Release Engineering <[email protected] >" imported
Original file line number Diff line number Diff line change @@ -87,6 +87,13 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
8787 " $@ " --initialize-insecure
8888 echo ' Database initialized'
8989
90+ if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e " $DATADIR /server-key.pem" ]; then
91+ # https://github.com/mysql/mysql-server/blob/23032807537d8dd8ee4ec1c4d40f0633cd4e12f9/packaging/deb-in/extra/mysql-systemd-start#L81-L84
92+ echo ' Initializing certificates'
93+ mysql_ssl_rsa_setup --datadir=" $DATADIR "
94+ echo ' Certificates initialized'
95+ fi
96+
9097 " $@ " --skip-networking --socket=/var/run/mysqld/mysqld.sock &
9198 pid=" $! "
9299
Original file line number Diff line number Diff line change @@ -19,12 +19,18 @@ RUN set -x \
1919
2020RUN mkdir /docker-entrypoint-initdb.d
2121
22+ RUN apt-get update && apt-get install -y --no-install-recommends \
23+ # for MYSQL_RANDOM_ROOT_PASSWORD
24+ pwgen \
25+ # for mysql_ssl_rsa_setup
26+ openssl \
2227# FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db:
2328# File::Basename
2429# File::Copy
2530# Sys::Hostname
2631# Data::Dumper
27- RUN apt-get update && apt-get install -y perl pwgen --no-install-recommends && rm -rf /var/lib/apt/lists/*
32+ perl \
33+ && rm -rf /var/lib/apt/lists/*
2834
2935RUN set -ex; \
3036# gpg: key 5072E1F5: public key "MySQL Release Engineering <[email protected] >" imported
Original file line number Diff line number Diff line change @@ -87,6 +87,13 @@ if [ "$1" = 'mysqld' -a -z "$wantHelp" ]; then
8787 " $@ " --initialize-insecure
8888 echo ' Database initialized'
8989
90+ if command -v mysql_ssl_rsa_setup > /dev/null && [ ! -e " $DATADIR /server-key.pem" ]; then
91+ # https://github.com/mysql/mysql-server/blob/23032807537d8dd8ee4ec1c4d40f0633cd4e12f9/packaging/deb-in/extra/mysql-systemd-start#L81-L84
92+ echo ' Initializing certificates'
93+ mysql_ssl_rsa_setup --datadir=" $DATADIR "
94+ echo ' Certificates initialized'
95+ fi
96+
9097 " $@ " --skip-networking --socket=/var/run/mysqld/mysqld.sock &
9198 pid=" $! "
9299
You can’t perform that action at this time.
0 commit comments