diff --git a/5.5/Dockerfile b/5.5/Dockerfile index eca336a2d..dac1c5bde 100644 --- a/5.5/Dockerfile +++ b/5.5/Dockerfile @@ -1,8 +1,10 @@ -FROM debian:jessie +FROM debian:stretch-slim # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r mysql && useradd -r -g mysql mysql +RUN apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr && rm -rf /var/lib/apt/lists/* + # add gosu for easy step-down from root ENV GOSU_VERSION 1.7 RUN set -x \ @@ -12,22 +14,27 @@ RUN set -x \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ + && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && gosu nobody true \ && apt-get purge -y --auto-remove ca-certificates wget RUN mkdir /docker-entrypoint-initdb.d +RUN apt-get update && apt-get install -y --no-install-recommends \ +# for MYSQL_RANDOM_ROOT_PASSWORD + pwgen \ # FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db: # File::Basename # File::Copy # Sys::Hostname # Data::Dumper -RUN apt-get update && apt-get install -y perl --no-install-recommends && rm -rf /var/lib/apt/lists/* - + perl \ # mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory -RUN apt-get update && apt-get install -y libaio1 pwgen && rm -rf /var/lib/apt/lists/* + libaio1 \ +# mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory + libncurses5 \ + && rm -rf /var/lib/apt/lists/* ENV MYSQL_MAJOR 5.5 ENV MYSQL_VERSION 5.5.59 @@ -40,7 +47,7 @@ RUN apt-get update && apt-get install -y ca-certificates wget --no-install-recom # gpg: key 5072E1F5: public key "MySQL Release Engineering " imported && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5 \ && gpg --batch --verify mysql.tar.gz.asc mysql.tar.gz \ - && rm -r "$GNUPGHOME" mysql.tar.gz.asc \ + && rm -rf "$GNUPGHOME" mysql.tar.gz.asc \ && mkdir /usr/local/mysql \ && tar -xzf mysql.tar.gz -C /usr/local/mysql --strip-components=1 \ && rm mysql.tar.gz \ diff --git a/5.6/Dockerfile b/5.6/Dockerfile index c8806909f..7512a7f01 100644 --- a/5.6/Dockerfile +++ b/5.6/Dockerfile @@ -1,8 +1,10 @@ -FROM debian:jessie +FROM debian:stretch-slim # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r mysql && useradd -r -g mysql mysql +RUN apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr && rm -rf /var/lib/apt/lists/* + # add gosu for easy step-down from root ENV GOSU_VERSION 1.7 RUN set -x \ @@ -12,19 +14,23 @@ RUN set -x \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ + && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && gosu nobody true \ && apt-get purge -y --auto-remove ca-certificates wget RUN mkdir /docker-entrypoint-initdb.d +RUN apt-get update && apt-get install -y --no-install-recommends \ +# for MYSQL_RANDOM_ROOT_PASSWORD + pwgen \ # FATAL ERROR: please install the following Perl modules before executing /usr/local/mysql/scripts/mysql_install_db: # File::Basename # File::Copy # Sys::Hostname # Data::Dumper -RUN apt-get update && apt-get install -y perl pwgen --no-install-recommends && rm -rf /var/lib/apt/lists/* + perl \ + && rm -rf /var/lib/apt/lists/* RUN set -ex; \ # gpg: key 5072E1F5: public key "MySQL Release Engineering " imported @@ -32,13 +38,13 @@ RUN set -ex; \ export GNUPGHOME="$(mktemp -d)"; \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ gpg --export "$key" > /etc/apt/trusted.gpg.d/mysql.gpg; \ - rm -r "$GNUPGHOME"; \ + rm -rf "$GNUPGHOME"; \ apt-key list > /dev/null ENV MYSQL_MAJOR 5.6 -ENV MYSQL_VERSION 5.6.39-1debian8 +ENV MYSQL_VERSION 5.6.39-1debian9 -RUN echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list +RUN echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter diff --git a/5.7/Dockerfile b/5.7/Dockerfile index 5813c376b..4bf4d9f60 100644 --- a/5.7/Dockerfile +++ b/5.7/Dockerfile @@ -1,8 +1,10 @@ -FROM debian:jessie +FROM debian:stretch-slim # add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added RUN groupadd -r mysql && useradd -r -g mysql mysql +RUN apt-get update && apt-get install -y --no-install-recommends gnupg dirmngr && rm -rf /var/lib/apt/lists/* + # add gosu for easy step-down from root ENV GOSU_VERSION 1.7 RUN set -x \ @@ -12,7 +14,7 @@ RUN set -x \ && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ + && rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && gosu nobody true \ && apt-get purge -y --auto-remove ca-certificates wget @@ -38,13 +40,13 @@ RUN set -ex; \ export GNUPGHOME="$(mktemp -d)"; \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ gpg --export "$key" > /etc/apt/trusted.gpg.d/mysql.gpg; \ - rm -r "$GNUPGHOME"; \ + rm -rf "$GNUPGHOME"; \ apt-key list > /dev/null ENV MYSQL_MAJOR 5.7 -ENV MYSQL_VERSION 5.7.21-1debian8 +ENV MYSQL_VERSION 5.7.21-1debian9 -RUN echo "deb http://repo.mysql.com/apt/debian/ jessie mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list +RUN echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-${MYSQL_MAJOR}" > /etc/apt/sources.list.d/mysql.list # the "/var/lib/mysql" stuff here is because the mysql-server postinst doesn't have an explicit way to disable the mysql_install_db codepath besides having a database already "configured" (ie, stuff in /var/lib/mysql/mysql) # also, we set debconf keys to make APT a little quieter diff --git a/update.sh b/update.sh index cb6f19fac..da85ee211 100755 --- a/update.sh +++ b/update.sh @@ -11,9 +11,7 @@ versions=( "${versions[@]%/}" ) defaultDebianVariant='stretch-slim' declare -A debianVariants=( - [5.5]='jessie' - [5.6]='jessie' - [5.7]='jessie' + #[5.5]='jessie' ) for version in "${versions[@]}"; do