-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
160 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,25 @@ FROM debian:jessie | |
# 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 | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
# add gosu for easy step-down from root | ||
ENV GOSU_VERSION 1.7 | ||
RUN set -x \ | ||
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \ | ||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ | ||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ | ||
&& 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 \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& gosu nobody true \ | ||
&& apt-get purge -y --auto-remove ca-certificates wget | ||
|
||
RUN mkdir /docker-entrypoint-initdb.d | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
|
||
# Key fingerprint = 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB | ||
# MariaDB Package Signing Key <[email protected]> | ||
# Key fingerprint = 430B DF5C 56E7 C94E 848E E60C 1C4C BDCD CD2E FD2A | ||
|
@@ -48,8 +62,13 @@ RUN { \ | |
percona-xtrabackup \ | ||
socat \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/lib/mysql \ | ||
&& mkdir /var/lib/mysql | ||
# comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching) | ||
&& sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/* \ | ||
# purge and re-create /var/lib/mysql with appropriate ownership | ||
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ | ||
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ | ||
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime | ||
&& chmod 777 /var/run/mysqld | ||
|
||
# comment out a few problematic configuration values | ||
# don't reverse lookup hostnames, they are usually another container | ||
|
@@ -59,9 +78,9 @@ RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \ | |
|
||
VOLUME /var/lib/mysql | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
EXPOSE 3306 | ||
CMD ["mysqld"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,25 @@ FROM debian:jessie | |
# 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 | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
# add gosu for easy step-down from root | ||
ENV GOSU_VERSION 1.7 | ||
RUN set -x \ | ||
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \ | ||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ | ||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ | ||
&& 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 \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& gosu nobody true \ | ||
&& apt-get purge -y --auto-remove ca-certificates wget | ||
|
||
RUN mkdir /docker-entrypoint-initdb.d | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
|
||
# Key fingerprint = 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB | ||
# MariaDB Package Signing Key <[email protected]> | ||
# Key fingerprint = 430B DF5C 56E7 C94E 848E E60C 1C4C BDCD CD2E FD2A | ||
|
@@ -48,8 +62,13 @@ RUN { \ | |
percona-xtrabackup \ | ||
socat \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/lib/mysql \ | ||
&& mkdir /var/lib/mysql | ||
# comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching) | ||
&& sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/* \ | ||
# purge and re-create /var/lib/mysql with appropriate ownership | ||
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ | ||
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ | ||
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime | ||
&& chmod 777 /var/run/mysqld | ||
|
||
# comment out a few problematic configuration values | ||
# don't reverse lookup hostnames, they are usually another container | ||
|
@@ -59,9 +78,9 @@ RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \ | |
|
||
VOLUME /var/lib/mysql | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
EXPOSE 3306 | ||
CMD ["mysqld"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,25 @@ FROM debian:wheezy | |
# 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 | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
# add gosu for easy step-down from root | ||
ENV GOSU_VERSION 1.7 | ||
RUN set -x \ | ||
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \ | ||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ | ||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ | ||
&& 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 \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& gosu nobody true \ | ||
&& apt-get purge -y --auto-remove ca-certificates wget | ||
|
||
RUN mkdir /docker-entrypoint-initdb.d | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
|
||
# Key fingerprint = 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB | ||
# MariaDB Package Signing Key <[email protected]> | ||
# Key fingerprint = 430B DF5C 56E7 C94E 848E E60C 1C4C BDCD CD2E FD2A | ||
|
@@ -48,8 +62,13 @@ RUN { \ | |
percona-xtrabackup \ | ||
socat \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/lib/mysql \ | ||
&& mkdir /var/lib/mysql | ||
# comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching) | ||
&& sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/* \ | ||
# purge and re-create /var/lib/mysql with appropriate ownership | ||
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ | ||
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ | ||
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime | ||
&& chmod 777 /var/run/mysqld | ||
|
||
# comment out a few problematic configuration values | ||
# don't reverse lookup hostnames, they are usually another container | ||
|
@@ -59,9 +78,9 @@ RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \ | |
|
||
VOLUME /var/lib/mysql | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
EXPOSE 3306 | ||
CMD ["mysqld"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,25 @@ FROM debian:%%SUITE%% | |
# 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 | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
# add gosu for easy step-down from root | ||
ENV GOSU_VERSION 1.7 | ||
RUN set -x \ | ||
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \ | ||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ | ||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ | ||
&& 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 \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& gosu nobody true \ | ||
&& apt-get purge -y --auto-remove ca-certificates wget | ||
|
||
RUN mkdir /docker-entrypoint-initdb.d | ||
|
||
# install "pwgen" for randomizing passwords | ||
RUN apt-get update && apt-get install -y pwgen && rm -rf /var/lib/apt/lists/* | ||
|
||
# Key fingerprint = 1993 69E5 404B D5FC 7D2F E43B CBCB 082A 1BB9 43DB | ||
# MariaDB Package Signing Key <[email protected]> | ||
# Key fingerprint = 430B DF5C 56E7 C94E 848E E60C 1C4C BDCD CD2E FD2A | ||
|
@@ -48,8 +62,13 @@ RUN { \ | |
percona-xtrabackup \ | ||
socat \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& rm -rf /var/lib/mysql \ | ||
&& mkdir /var/lib/mysql | ||
# comment out any "user" entires in the MySQL config ("docker-entrypoint.sh" or "--user" will handle user switching) | ||
&& sed -ri 's/^user\s/#&/' /etc/mysql/my.cnf /etc/mysql/conf.d/* \ | ||
# purge and re-create /var/lib/mysql with appropriate ownership | ||
&& rm -rf /var/lib/mysql && mkdir -p /var/lib/mysql /var/run/mysqld \ | ||
&& chown -R mysql:mysql /var/lib/mysql /var/run/mysqld \ | ||
# ensure that /var/run/mysqld (used for socket and lock files) is writable regardless of the UID our mysqld instance ends up having at runtime | ||
&& chmod 777 /var/run/mysqld | ||
|
||
# comment out a few problematic configuration values | ||
# don't reverse lookup hostnames, they are usually another container | ||
|
@@ -59,9 +78,9 @@ RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnf \ | |
|
||
VOLUME /var/lib/mysql | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
COPY docker-entrypoint.sh /usr/local/bin/ | ||
RUN ln -s usr/local/bin/docker-entrypoint.sh /entrypoint.sh # backwards compat | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
EXPOSE 3306 | ||
CMD ["mysqld"] |
Oops, something went wrong.
I believe
/entrypoint.sh
should be/docker-entrypoint.sh
, since my builds failed because of this change