From 747364efe4882ce2281340a1326ac3d6f3106e2d Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 13:10:55 +0100 Subject: [PATCH 1/7] Ensure to test against common entrypoint --- tests/00-entrypoint.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 tests/00-entrypoint.sh diff --git a/tests/00-entrypoint.sh b/tests/00-entrypoint.sh new file mode 100755 index 0000000..526d301 --- /dev/null +++ b/tests/00-entrypoint.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -e +set -u +set -o pipefail + +IMAGE="devilbox/mysql" +TYPE="${1}" +VERSION="${2}" + + +# Ensure they all have a common entrypoint +docker image inspect "${IMAGE}:${TYPE}-${VERSION}" \ + | grep '"Entrypoint":' -A 1 \ + | grep '"docker-entrypoint.sh"' From ab499eee36e885750e4a8336e64128730dacbbc8 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 13:19:02 +0100 Subject: [PATCH 2/7] Enable GitHub Actions --- .github/workflows/mysql-ci.yml | 100 +++++++++++++++++++++++++++++++++ README.md | 1 + tests/01-version.sh | 6 +- tests/02-mysqli.sh | 47 +++++++++++----- tests/03-config.sh | 15 +++-- 5 files changed, 145 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/mysql-ci.yml diff --git a/.github/workflows/mysql-ci.yml b/.github/workflows/mysql-ci.yml new file mode 100644 index 0000000..07835d0 --- /dev/null +++ b/.github/workflows/mysql-ci.yml @@ -0,0 +1,100 @@ +--- + +# ------------------------------------------------------------------------------------------------- +# Job Name +# ------------------------------------------------------------------------------------------------- +name: MYSQL-CI + + +# ------------------------------------------------------------------------------------------------- +# When to run +# ------------------------------------------------------------------------------------------------- +on: + # Runs on Pull Requests + pull_request: + + # Runs on master Branch and Tags + push: + branches: + - master + tags: + - '[0-9]+.[0-9]+*' + + +# ------------------------------------------------------------------------------------------------- +# What to run +# ------------------------------------------------------------------------------------------------- +jobs: + build: + name: "[ MYSQL-${{ matrix.version }} ]" + runs-on: ubuntu-latest + strategy: + fail-fast: False + matrix: + version: + - 'mysql-5.5' + - 'mysql-5.6' + - 'mysql-5.7' + - 'mysql-8.0' + - 'mariadb-5.5' + - 'mariadb-10.0' + - 'mariadb-10.1' + - 'mariadb-10.2' + - 'mariadb-10.3' + - 'mariadb-10.4' + - 'mariadb-10.5' + - 'percona-5.5' + - 'percona-5.6' + - 'percona-5.7' + - 'percona-8.0' + steps: + + # ------------------------------------------------------------ + # Checkout repository + # ------------------------------------------------------------ + - name: Checkout repository + uses: actions/checkout@v2 + + # ------------------------------------------------------------ + # Build + # ------------------------------------------------------------ + - name: Build + run: | + retry() { + for n in $(seq ${RETRIES}); do + echo "[${n}/${RETRIES}] ${*}"; + if eval "${*}"; then + echo "[SUCC] ${n}/${RETRIES}"; + return 0; + fi; + sleep 2; + echo "[FAIL] ${n}/${RETRIES}"; + done; + return 1; + } + retry make build-${VERSION} + env: + VERSION: ${{ matrix.version }} + RETRIES: 20 + + # ------------------------------------------------------------ + # Test + # ------------------------------------------------------------ + - name: Test + run: | + retry() { + for n in $(seq ${RETRIES}); do + echo "[${n}/${RETRIES}] ${*}"; + if eval "${*}"; then + echo "[SUCC] ${n}/${RETRIES}"; + return 0; + fi; + sleep 2; + echo "[FAIL] ${n}/${RETRIES}"; + done; + return 1; + } + retry make test-${VERSION} + env: + VERSION: ${{ matrix.version }} + RETRIES: 20 diff --git a/README.md b/README.md index 3b5c278..be9c3e9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # MySQL Docker images [![Build Status](https://travis-ci.org/devilbox/docker-mysql.svg?branch=master)](https://travis-ci.org/devilbox/docker-mysql) +[![CI](https://github.com/devilbox/docker-mysql/workflows/MYSQL-CI/badge.svg)](https://github.com/devilbox/docker-mysql/actions?workflow=MYSQL-CI) [![Tag](https://img.shields.io/github/tag/devilbox/docker-mysql.svg)](https://github.com/devilbox/docker-mysql/releases) [![Gitter](https://badges.gitter.im/devilbox/Lobby.svg)](https://gitter.im/devilbox/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Discourse](https://img.shields.io/discourse/https/devilbox.discourse.group/status.svg?colorB=%234CB697)](https://devilbox.discourse.group) diff --git a/tests/01-version.sh b/tests/01-version.sh index 54946d6..1ad5a74 100755 --- a/tests/01-version.sh +++ b/tests/01-version.sh @@ -9,11 +9,11 @@ VERSION="${2}" if [ "${TYPE}" = "mysql" ]; then - docker run --rm -it "${IMAGE}:${TYPE}-${VERSION}" -V | grep 'MySQL' | grep "${VERSION/./\\.}" + docker run --rm $(tty -s && echo "-it" || echo) "${IMAGE}:${TYPE}-${VERSION}" -V | grep 'MySQL' | grep "${VERSION/./\\.}" elif [ "${TYPE}" = "mariadb" ]; then - docker run --rm -it "${IMAGE}:${TYPE}-${VERSION}" -V | grep 'MariaDB' | grep "${VERSION/./\\.}" + docker run --rm $(tty -s && echo "-it" || echo) "${IMAGE}:${TYPE}-${VERSION}" -V | grep 'MariaDB' | grep "${VERSION/./\\.}" elif [ "${TYPE}" = "percona" ]; then - docker run --rm -it "${IMAGE}:${TYPE}-${VERSION}" -V | grep 'Percona' | grep "${VERSION/./\\.}" + docker run --rm $(tty -s && echo "-it" || echo) "${IMAGE}:${TYPE}-${VERSION}" -V | grep 'Percona' | grep "${VERSION/./\\.}" else >&2 echo "[ERROR] Wrong type: ${TYPE}" exit 1 diff --git a/tests/02-mysqli.sh b/tests/02-mysqli.sh index 3736152..6a1d178 100755 --- a/tests/02-mysqli.sh +++ b/tests/02-mysqli.sh @@ -13,7 +13,7 @@ SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" echo "1/5 Starting MySQL" docker run \ -d \ - -it \ + $(tty -s && echo "-it" || echo) \ --rm \ --hostname=mysql \ --name devilbox-test-mysql \ @@ -30,39 +30,56 @@ done echo "3/5 Starting PHP" docker run \ -d \ - -it \ + $(tty -s && echo "-it" || echo) \ --rm \ --hostname=php \ - --entrypoint=bash \ --name devilbox-test-php \ --volume="${SCRIPTPATH}:/tmp" \ - --link devilbox-test-mysql php:7.2 + --link devilbox-test-mysql php:7.2 sh -c 'sleep 9000' # Install PHP mysqli module echo "4/5 Installing mysqli extension" -docker exec -it devilbox-test-php docker-php-ext-install mysqli +if ! docker exec $(tty -s && echo "-it" || echo) devilbox-test-php sh -c 'docker-php-ext-install mysqli'; then + docker logs devilbox-test-php 2>/dev/null || true + docker logs devilbox-test-mysql 2>/dev/null || true + docker stop devilbox-test-php 2>/dev/null || true + docker stop devilbox-test-mysql 2>/dev/null || true + docker kill devilbox-test-php 2>/dev/null || true + docker kill devilbox-test-mysql 2>/dev/null || true + docker rm -f devilbox-test-php 2>/dev/null || true + docker rm -f devilbox-test-mysql 2>/dev/null || true + exit 1 +fi # Test MySQL connectivity max=100 i=0 printf "5/5 Testing mysqli extension " -while ! docker exec -it devilbox-test-php php /tmp/mysql.php >/dev/null 2>&1; do +while ! docker exec $(tty -s && echo "-it" || echo) devilbox-test-php php /tmp/mysql.php >/dev/null 2>&1; do printf "." sleep 1 i=$(( i + 1)) if [ "${i}" -ge "${max}" ]; then - printf "\n" + printf "\\n" >&2 echo "Failed" - docker exec -it devilbox-test-php php /tmp/mysql.php || true - docker logs devilbox-test-php || true - docker logs devilbox-test-mysql || true - docker stop devilbox-test-php || true - docker stop devilbox-test-mysql || true + docker exec $(tty -s && echo "-it" || echo) devilbox-test-php php /tmp/mysql.php || true + docker logs devilbox-test-php 2>/dev/null || true + docker logs devilbox-test-mysql 2>/dev/null || true + docker stop devilbox-test-php 2>/dev/null || true + docker stop devilbox-test-mysql 2>/dev/null || true + docker kill devilbox-test-php 2>/dev/null || true + docker kill devilbox-test-mysql 2>/dev/null || true + docker rm -f devilbox-test-php 2>/dev/null || true + docker rm -f devilbox-test-mysql 2>/dev/null || true exit 1 fi done -printf "\n" +printf "\\n" -docker stop devilbox-test-php || true -docker stop devilbox-test-mysql || true +docker stop devilbox-test-php 2>/dev/null || true +docker stop devilbox-test-mysql 2>/dev/null || true +docker kill devilbox-test-php 2>/dev/null || true +docker kill devilbox-test-mysql 2>/dev/null || true +docker rm -f devilbox-test-php 2>/dev/null || true +docker rm -f devilbox-test-mysql 2>/dev/null || true echo "Success" diff --git a/tests/03-config.sh b/tests/03-config.sh index 868885b..f4e8ab5 100755 --- a/tests/03-config.sh +++ b/tests/03-config.sh @@ -19,7 +19,7 @@ echo "${CNF_KEY} = ${CNF_VAL}" >> "${CNF_DIR}/config.cnf" # Start MySQL docker run \ -d \ - -it \ + $(tty -s && echo "-it" || echo) \ --rm \ --hostname=mysql \ --name devilbox-test-mysql \ @@ -30,19 +30,22 @@ docker run \ # Test MySQL connectivity max=100 i=0 -while ! docker exec -it devilbox-test-mysql mysql -uroot --password="" -h 127.0.0.1 -e "SHOW VARIABLES LIKE '%${CNF_KEY}%';" | grep "${CNF_VAL}"; do +while ! docker exec $(tty -s && echo "-it" || echo) devilbox-test-mysql mysql -uroot --password="" -h 127.0.0.1 -e "SHOW VARIABLES LIKE '%${CNF_KEY}%';" | grep "${CNF_VAL}"; do sleep 1 i=$(( i + 1)) if [ "${i}" -ge "${max}" ]; then - docker logs devilbox-test-mysql || true - docker stop devilbox-test-mysql || true - docker kill devilbox-test-mysql || true + docker logs devilbox-test-mysql 2>/dev/null || true + docker stop devilbox-test-mysql 2>/dev/null || true + docker kill devilbox-test-mysql 2>/dev/null || true + docker rm -f devilbox-test-mysql 2>/dev/null || true rm -rf "${CNF_DIR}" || true >&2 echo "Failed" exit 1 fi done -docker stop devilbox-test-mysql || true +docker stop devilbox-test-mysql 2>/dev/null || true +docker kill devilbox-test-mysql 2>/dev/null || true +docker rm -f devilbox-test-mysql 2>/dev/null || true rm -rf "${CNF_DIR}" || true echo "Success" From 0d35e7219a405c974f53e2f1eb111da87abba6e5 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 14:13:22 +0100 Subject: [PATCH 3/7] Fix entrypoint.sh --- Dockerfiles/mariadb-10.0 | 5 ++++- Dockerfiles/mariadb-10.1 | 5 ++++- Dockerfiles/mariadb-10.2 | 5 ++++- Dockerfiles/mariadb-10.3 | 5 ++++- Dockerfiles/mariadb-10.4 | 5 ++++- Dockerfiles/mariadb-10.5 | 5 ++++- Dockerfiles/mariadb-5.5 | 5 ++++- Dockerfiles/mysql-5.5 | 5 ++++- Dockerfiles/mysql-5.6 | 5 ++++- Dockerfiles/mysql-5.7 | 5 ++++- Dockerfiles/mysql-8.0 | 5 ++++- Dockerfiles/percona-5.5 | 5 ++++- Dockerfiles/percona-5.6 | 5 ++++- Dockerfiles/percona-5.7 | 5 ++++- Dockerfiles/percona-8.0 | 5 ++++- tests/00-entrypoint.sh | 7 +++++-- 16 files changed, 65 insertions(+), 17 deletions(-) diff --git a/Dockerfiles/mariadb-10.0 b/Dockerfiles/mariadb-10.0 index a986a86..eae3b35 100644 --- a/Dockerfiles/mariadb-10.0 +++ b/Dockerfiles/mariadb-10.0 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.1 b/Dockerfiles/mariadb-10.1 index b6135a8..7c9465f 100644 --- a/Dockerfiles/mariadb-10.1 +++ b/Dockerfiles/mariadb-10.1 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.2 b/Dockerfiles/mariadb-10.2 index c47b673..288d741 100644 --- a/Dockerfiles/mariadb-10.2 +++ b/Dockerfiles/mariadb-10.2 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.3 b/Dockerfiles/mariadb-10.3 index c73f171..1500ac7 100644 --- a/Dockerfiles/mariadb-10.3 +++ b/Dockerfiles/mariadb-10.3 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.4 b/Dockerfiles/mariadb-10.4 index b0ad507..15dd334 100644 --- a/Dockerfiles/mariadb-10.4 +++ b/Dockerfiles/mariadb-10.4 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.5 b/Dockerfiles/mariadb-10.5 index d3cae5c..ce28465 100644 --- a/Dockerfiles/mariadb-10.5 +++ b/Dockerfiles/mariadb-10.5 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-5.5 b/Dockerfiles/mariadb-5.5 index 98426c1..f132b04 100644 --- a/Dockerfiles/mariadb-5.5 +++ b/Dockerfiles/mariadb-5.5 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.5 b/Dockerfiles/mysql-5.5 index 1dd24a4..0b5b6cd 100644 --- a/Dockerfiles/mysql-5.5 +++ b/Dockerfiles/mysql-5.5 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.6 b/Dockerfiles/mysql-5.6 index c67d5c2..aebc492 100644 --- a/Dockerfiles/mysql-5.6 +++ b/Dockerfiles/mysql-5.6 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.7 b/Dockerfiles/mysql-5.7 index b7a5d1a..26cb871 100644 --- a/Dockerfiles/mysql-5.7 +++ b/Dockerfiles/mysql-5.7 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-8.0 b/Dockerfiles/mysql-8.0 index 082f483..a510b93 100644 --- a/Dockerfiles/mysql-8.0 +++ b/Dockerfiles/mysql-8.0 @@ -12,4 +12,7 @@ RUN set -eux \ false; \ fi \ # Allow native password handling for MySQL 8.0 - && sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/mysql/my.cnf + && sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/mysql/my.cnf \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.5 b/Dockerfiles/percona-5.5 index 8c42889..3997fa7 100644 --- a/Dockerfiles/percona-5.5 +++ b/Dockerfiles/percona-5.5 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.6 b/Dockerfiles/percona-5.6 index b1cc659..264103c 100644 --- a/Dockerfiles/percona-5.6 +++ b/Dockerfiles/percona-5.6 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.7 b/Dockerfiles/percona-5.7 index f324d60..8dcadd6 100644 --- a/Dockerfiles/percona-5.7 +++ b/Dockerfiles/percona-5.7 @@ -10,4 +10,7 @@ RUN set -eux \ else \ echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ false; \ - fi + fi \ + && chmod +x "/docker-entrypoint.sh" + +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-8.0 b/Dockerfiles/percona-8.0 index a387dad..7e54acf 100644 --- a/Dockerfiles/percona-8.0 +++ b/Dockerfiles/percona-8.0 @@ -13,5 +13,8 @@ RUN set -eux \ false; \ fi \ # Allow native password handling for MySQL 8.0 - && sed -i'' "s|^pid-file=.*$|pid-file=/var/run/mysqld/mysqld.pid\ndefault-authentication-plugin=mysql_native_password|g" /etc/my.cnf + && sed -i'' "s|^pid-file=.*$|pid-file=/var/run/mysqld/mysqld.pid\ndefault-authentication-plugin=mysql_native_password|g" /etc/my.cnf \ + && chmod +x "/docker-entrypoint.sh" + USER mysql +ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/tests/00-entrypoint.sh b/tests/00-entrypoint.sh index 526d301..b888087 100755 --- a/tests/00-entrypoint.sh +++ b/tests/00-entrypoint.sh @@ -9,6 +9,9 @@ VERSION="${2}" # Ensure they all have a common entrypoint -docker image inspect "${IMAGE}:${TYPE}-${VERSION}" \ +if ! docker image inspect "${IMAGE}:${TYPE}-${VERSION}" \ | grep '"Entrypoint":' -A 1 \ - | grep '"docker-entrypoint.sh"' + | grep -E '"/?docker-entrypoint.sh"'; then + docker image inspect "${IMAGE}:${TYPE}-${VERSION}" | grep -i "entrypoint" || true + exit 1 +fi From 41a518c621248e2fe5275c5f6b40203ed5bab23a Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 14:17:53 +0100 Subject: [PATCH 4/7] Fix CMD --- Dockerfiles/mariadb-10.0 | 1 + Dockerfiles/mariadb-10.1 | 1 + Dockerfiles/mariadb-10.2 | 1 + Dockerfiles/mariadb-10.3 | 1 + Dockerfiles/mariadb-10.4 | 1 + Dockerfiles/mariadb-10.5 | 1 + Dockerfiles/mariadb-5.5 | 1 + Dockerfiles/mysql-5.5 | 1 + Dockerfiles/mysql-5.6 | 1 + Dockerfiles/mysql-5.7 | 1 + Dockerfiles/mysql-8.0 | 1 + Dockerfiles/percona-5.5 | 1 + Dockerfiles/percona-5.6 | 1 + Dockerfiles/percona-5.7 | 1 + Dockerfiles/percona-8.0 | 1 + 15 files changed, 15 insertions(+) diff --git a/Dockerfiles/mariadb-10.0 b/Dockerfiles/mariadb-10.0 index eae3b35..6ec94aa 100644 --- a/Dockerfiles/mariadb-10.0 +++ b/Dockerfiles/mariadb-10.0 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mariadb-10.1 b/Dockerfiles/mariadb-10.1 index 7c9465f..84c8e4b 100644 --- a/Dockerfiles/mariadb-10.1 +++ b/Dockerfiles/mariadb-10.1 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mariadb-10.2 b/Dockerfiles/mariadb-10.2 index 288d741..9b31fed 100644 --- a/Dockerfiles/mariadb-10.2 +++ b/Dockerfiles/mariadb-10.2 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mariadb-10.3 b/Dockerfiles/mariadb-10.3 index 1500ac7..51a268d 100644 --- a/Dockerfiles/mariadb-10.3 +++ b/Dockerfiles/mariadb-10.3 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mariadb-10.4 b/Dockerfiles/mariadb-10.4 index 15dd334..6a8c03a 100644 --- a/Dockerfiles/mariadb-10.4 +++ b/Dockerfiles/mariadb-10.4 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mariadb-10.5 b/Dockerfiles/mariadb-10.5 index ce28465..aa966dd 100644 --- a/Dockerfiles/mariadb-10.5 +++ b/Dockerfiles/mariadb-10.5 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mariadb-5.5 b/Dockerfiles/mariadb-5.5 index f132b04..03fab8d 100644 --- a/Dockerfiles/mariadb-5.5 +++ b/Dockerfiles/mariadb-5.5 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mysql-5.5 b/Dockerfiles/mysql-5.5 index 0b5b6cd..deabbda 100644 --- a/Dockerfiles/mysql-5.5 +++ b/Dockerfiles/mysql-5.5 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mysql-5.6 b/Dockerfiles/mysql-5.6 index aebc492..e56d9a7 100644 --- a/Dockerfiles/mysql-5.6 +++ b/Dockerfiles/mysql-5.6 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mysql-5.7 b/Dockerfiles/mysql-5.7 index 26cb871..01df499 100644 --- a/Dockerfiles/mysql-5.7 +++ b/Dockerfiles/mysql-5.7 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/mysql-8.0 b/Dockerfiles/mysql-8.0 index a510b93..5709f98 100644 --- a/Dockerfiles/mysql-8.0 +++ b/Dockerfiles/mysql-8.0 @@ -16,3 +16,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/percona-5.5 b/Dockerfiles/percona-5.5 index 3997fa7..1e8156e 100644 --- a/Dockerfiles/percona-5.5 +++ b/Dockerfiles/percona-5.5 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/percona-5.6 b/Dockerfiles/percona-5.6 index 264103c..ab467a7 100644 --- a/Dockerfiles/percona-5.6 +++ b/Dockerfiles/percona-5.6 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/percona-5.7 b/Dockerfiles/percona-5.7 index 8dcadd6..a2b71fb 100644 --- a/Dockerfiles/percona-5.7 +++ b/Dockerfiles/percona-5.7 @@ -14,3 +14,4 @@ RUN set -eux \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] diff --git a/Dockerfiles/percona-8.0 b/Dockerfiles/percona-8.0 index 7e54acf..78aa2b7 100644 --- a/Dockerfiles/percona-8.0 +++ b/Dockerfiles/percona-8.0 @@ -18,3 +18,4 @@ RUN set -eux \ USER mysql ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["mysqld"] From c441f1f77ac6324af78af906921104585ec57a60 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 14:29:29 +0100 Subject: [PATCH 5/7] Fix entrypoint and permissions --- Dockerfiles/mariadb-10.0 | 5 ++++- Dockerfiles/mariadb-10.1 | 5 ++++- Dockerfiles/mariadb-10.2 | 5 ++++- Dockerfiles/mariadb-10.3 | 5 ++++- Dockerfiles/mariadb-10.4 | 5 ++++- Dockerfiles/mariadb-10.5 | 5 ++++- Dockerfiles/mariadb-5.5 | 5 ++++- Dockerfiles/mysql-5.5 | 5 ++++- Dockerfiles/mysql-5.6 | 5 ++++- Dockerfiles/mysql-5.7 | 5 ++++- Dockerfiles/mysql-8.0 | 5 ++++- Dockerfiles/percona-5.5 | 5 ++++- Dockerfiles/percona-5.6 | 7 ++++++- Dockerfiles/percona-5.7 | 7 ++++++- Dockerfiles/percona-8.0 | 5 ++++- 15 files changed, 64 insertions(+), 15 deletions(-) diff --git a/Dockerfiles/mariadb-10.0 b/Dockerfiles/mariadb-10.0 index 6ec94aa..ead1a3b 100644 --- a/Dockerfiles/mariadb-10.0 +++ b/Dockerfiles/mariadb-10.0 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.1 b/Dockerfiles/mariadb-10.1 index 84c8e4b..93fe0d5 100644 --- a/Dockerfiles/mariadb-10.1 +++ b/Dockerfiles/mariadb-10.1 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.2 b/Dockerfiles/mariadb-10.2 index 9b31fed..a4c1ae3 100644 --- a/Dockerfiles/mariadb-10.2 +++ b/Dockerfiles/mariadb-10.2 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.3 b/Dockerfiles/mariadb-10.3 index 51a268d..b0a8e1b 100644 --- a/Dockerfiles/mariadb-10.3 +++ b/Dockerfiles/mariadb-10.3 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.4 b/Dockerfiles/mariadb-10.4 index 6a8c03a..00979f8 100644 --- a/Dockerfiles/mariadb-10.4 +++ b/Dockerfiles/mariadb-10.4 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.5 b/Dockerfiles/mariadb-10.5 index aa966dd..6bdb780 100644 --- a/Dockerfiles/mariadb-10.5 +++ b/Dockerfiles/mariadb-10.5 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-5.5 b/Dockerfiles/mariadb-5.5 index 03fab8d..c8baea6 100644 --- a/Dockerfiles/mariadb-5.5 +++ b/Dockerfiles/mariadb-5.5 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.5 b/Dockerfiles/mysql-5.5 index deabbda..0ff84f1 100644 --- a/Dockerfiles/mysql-5.5 +++ b/Dockerfiles/mysql-5.5 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.6 b/Dockerfiles/mysql-5.6 index e56d9a7..fca6582 100644 --- a/Dockerfiles/mysql-5.6 +++ b/Dockerfiles/mysql-5.6 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.7 b/Dockerfiles/mysql-5.7 index 01df499..452ca36 100644 --- a/Dockerfiles/mysql-5.7 +++ b/Dockerfiles/mysql-5.7 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-8.0 b/Dockerfiles/mysql-8.0 index 5709f98..a278da4 100644 --- a/Dockerfiles/mysql-8.0 +++ b/Dockerfiles/mysql-8.0 @@ -8,11 +8,14 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ # Allow native password handling for MySQL 8.0 && sed -i'' 's/^\[mysqld\]/[mysqld]\ndefault-authentication-plugin=mysql_native_password/g' /etc/mysql/my.cnf \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.5 b/Dockerfiles/percona-5.5 index 1e8156e..15f743c 100644 --- a/Dockerfiles/percona-5.5 +++ b/Dockerfiles/percona-5.5 @@ -8,9 +8,12 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.6 b/Dockerfiles/percona-5.6 index ab467a7..5664175 100644 --- a/Dockerfiles/percona-5.6 +++ b/Dockerfiles/percona-5.6 @@ -1,6 +1,7 @@ # vi: ft=dockerfile FROM percona:5.6 +USER root RUN set -eux \ && mkdir -p /etc/mysql/docker-default.d/ \ && if [ -f /etc/my.cnf ]; then \ @@ -8,10 +9,14 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" +USER mysql ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["mysqld"] diff --git a/Dockerfiles/percona-5.7 b/Dockerfiles/percona-5.7 index a2b71fb..c06fbf1 100644 --- a/Dockerfiles/percona-5.7 +++ b/Dockerfiles/percona-5.7 @@ -1,6 +1,7 @@ # vi: ft=dockerfile FROM percona:5.7 +USER root RUN set -eux \ && mkdir -p /etc/mysql/docker-default.d/ \ && if [ -f /etc/my.cnf ]; then \ @@ -8,10 +9,14 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" +USER mysql ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["mysqld"] diff --git a/Dockerfiles/percona-8.0 b/Dockerfiles/percona-8.0 index 78aa2b7..6bf493b 100644 --- a/Dockerfiles/percona-8.0 +++ b/Dockerfiles/percona-8.0 @@ -9,11 +9,14 @@ RUN set -eux \ elif [ -f /etc/mysql/my.cnf ]; then \ echo '!'"includedir /etc/mysql/docker-default.d/" >> /etc/mysql/my.cnf; \ else \ - echo "/etc/my.cnf and /etc/mysql/my.cnf are not availanle"; \ + echo "/etc/my.cnf and /etc/mysql/my.cnf are not available"; \ false; \ fi \ # Allow native password handling for MySQL 8.0 && sed -i'' "s|^pid-file=.*$|pid-file=/var/run/mysqld/mysqld.pid\ndefault-authentication-plugin=mysql_native_password|g" /etc/my.cnf \ + && if [ -f "/entrypoint.sh" ]; then \ + mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" USER mysql From 9de68a88dcf5e92908a7de109fb3974928a74e83 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 14:36:44 +0100 Subject: [PATCH 6/7] Symlink missing entrypoint --- Dockerfiles/mariadb-10.0 | 3 +++ Dockerfiles/mariadb-10.1 | 3 +++ Dockerfiles/mariadb-10.2 | 3 +++ Dockerfiles/mariadb-10.3 | 3 +++ Dockerfiles/mariadb-10.4 | 3 +++ Dockerfiles/mariadb-10.5 | 3 +++ Dockerfiles/mariadb-5.5 | 3 +++ Dockerfiles/mysql-5.5 | 3 +++ Dockerfiles/mysql-5.6 | 3 +++ Dockerfiles/mysql-5.7 | 3 +++ Dockerfiles/mysql-8.0 | 3 +++ Dockerfiles/percona-5.5 | 3 +++ Dockerfiles/percona-5.6 | 3 +++ Dockerfiles/percona-5.7 | 3 +++ Dockerfiles/percona-8.0 | 3 +++ 15 files changed, 45 insertions(+) diff --git a/Dockerfiles/mariadb-10.0 b/Dockerfiles/mariadb-10.0 index ead1a3b..544aa3a 100644 --- a/Dockerfiles/mariadb-10.0 +++ b/Dockerfiles/mariadb-10.0 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.1 b/Dockerfiles/mariadb-10.1 index 93fe0d5..cf677a3 100644 --- a/Dockerfiles/mariadb-10.1 +++ b/Dockerfiles/mariadb-10.1 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.2 b/Dockerfiles/mariadb-10.2 index a4c1ae3..efc7460 100644 --- a/Dockerfiles/mariadb-10.2 +++ b/Dockerfiles/mariadb-10.2 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.3 b/Dockerfiles/mariadb-10.3 index b0a8e1b..f15958d 100644 --- a/Dockerfiles/mariadb-10.3 +++ b/Dockerfiles/mariadb-10.3 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.4 b/Dockerfiles/mariadb-10.4 index 00979f8..261f382 100644 --- a/Dockerfiles/mariadb-10.4 +++ b/Dockerfiles/mariadb-10.4 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-10.5 b/Dockerfiles/mariadb-10.5 index 6bdb780..5bae152 100644 --- a/Dockerfiles/mariadb-10.5 +++ b/Dockerfiles/mariadb-10.5 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mariadb-5.5 b/Dockerfiles/mariadb-5.5 index c8baea6..ea01e1e 100644 --- a/Dockerfiles/mariadb-5.5 +++ b/Dockerfiles/mariadb-5.5 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.5 b/Dockerfiles/mysql-5.5 index 0ff84f1..8769054 100644 --- a/Dockerfiles/mysql-5.5 +++ b/Dockerfiles/mysql-5.5 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.6 b/Dockerfiles/mysql-5.6 index fca6582..2879277 100644 --- a/Dockerfiles/mysql-5.6 +++ b/Dockerfiles/mysql-5.6 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-5.7 b/Dockerfiles/mysql-5.7 index 452ca36..b09bf1e 100644 --- a/Dockerfiles/mysql-5.7 +++ b/Dockerfiles/mysql-5.7 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/mysql-8.0 b/Dockerfiles/mysql-8.0 index a278da4..038abf2 100644 --- a/Dockerfiles/mysql-8.0 +++ b/Dockerfiles/mysql-8.0 @@ -16,6 +16,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.5 b/Dockerfiles/percona-5.5 index 15f743c..64ce7b1 100644 --- a/Dockerfiles/percona-5.5 +++ b/Dockerfiles/percona-5.5 @@ -14,6 +14,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/Dockerfiles/percona-5.6 b/Dockerfiles/percona-5.6 index 5664175..d066cf4 100644 --- a/Dockerfiles/percona-5.6 +++ b/Dockerfiles/percona-5.6 @@ -15,6 +15,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" USER mysql diff --git a/Dockerfiles/percona-5.7 b/Dockerfiles/percona-5.7 index c06fbf1..f494d50 100644 --- a/Dockerfiles/percona-5.7 +++ b/Dockerfiles/percona-5.7 @@ -15,6 +15,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" USER mysql diff --git a/Dockerfiles/percona-8.0 b/Dockerfiles/percona-8.0 index 6bf493b..2cae4d3 100644 --- a/Dockerfiles/percona-8.0 +++ b/Dockerfiles/percona-8.0 @@ -17,6 +17,9 @@ RUN set -eux \ && if [ -f "/entrypoint.sh" ]; then \ mv "/entrypoint.sh" "/docker-entrypoint.sh"; \ fi \ + && if [ ! -f "/docker-entrypoint.sh" ]; then \ + ln -s "/usr/local/bin/docker-entrypoint.sh" "/docker-entrypoint.sh"; \ + fi \ && chmod +x "/docker-entrypoint.sh" USER mysql From 40128b02cfd100abb38a3b7732548153f701d7e8 Mon Sep 17 00:00:00 2001 From: cytopia Date: Fri, 13 Nov 2020 14:44:28 +0100 Subject: [PATCH 7/7] Update description --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index be9c3e9..2cc44ae 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,23 @@ slightly customized/enhanced additions added: * MySQL 8.0 and Percona 8.0 by default use a new authentication mechanism which is not (yet) understood by PHP's mysqli module. For those two images, the old authentication type has been re-enabled, so you can still use it with your current PHP code. +## Defaults + +### Docker Image + +| What | Value | +|------------|-----------------------------| +| ENTRYPOINT | `["/docker-entrypoint.sh"]` | +| CMD | `["mysqld"]` | + +### Mountpoints + +| Path | Description | +|--------------------------------|----------------------------------------| +| `/etc/mysql/conf.d` | Default primary config mountpoint | +| `/etc/mysql/docker-default.d/` | Additional secondary config mountpoint | + + ## Docker Tags For retagged information see below.