mirror of
https://github.com/friendica/docker
synced 2024-12-28 20:19:34 +01:00
feat(): add tini as process manager
This commit is contained in:
parent
4755d3f602
commit
9e25e43fb9
16 changed files with 68 additions and 11 deletions
|
@ -11,9 +11,19 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
|
# For tini installation
|
||||||
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
# Add tini for reaping processes
|
||||||
|
ENV TINI_VERSION v0.18.0
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
||||||
|
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
|
||||||
|
&& gpg --batch --verify /tini.asc /sbin/tini \
|
||||||
|
&& chmod +x /sbin/tini
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,7 +8,8 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
shadow;
|
shadow \
|
||||||
|
tini;
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -11,9 +11,19 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
|
# For tini installation
|
||||||
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
# Add tini for reaping processes
|
||||||
|
ENV TINI_VERSION v0.18.0
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
||||||
|
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
|
||||||
|
&& gpg --batch --verify /tini.asc /sbin/tini \
|
||||||
|
&& chmod +x /sbin/tini
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -11,9 +11,19 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
|
# For tini installation
|
||||||
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
# Add tini for reaping processes
|
||||||
|
ENV TINI_VERSION v0.18.0
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
||||||
|
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
|
||||||
|
&& gpg --batch --verify /tini.asc /sbin/tini \
|
||||||
|
&& chmod +x /sbin/tini
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,7 +8,8 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
shadow;
|
shadow \
|
||||||
|
tini;
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -11,9 +11,19 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
|
# For tini installation
|
||||||
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
# Add tini for reaping processes
|
||||||
|
ENV TINI_VERSION v0.18.0
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
||||||
|
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
|
||||||
|
&& gpg --batch --verify /tini.asc /sbin/tini \
|
||||||
|
&& chmod +x /sbin/tini
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -7,7 +7,8 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
shadow;
|
shadow \
|
||||||
|
tini;
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
|
|
|
@ -10,9 +10,19 @@ RUN set -ex; \
|
||||||
git \
|
git \
|
||||||
# For mail() support
|
# For mail() support
|
||||||
ssmtp \
|
ssmtp \
|
||||||
|
# For tini installation
|
||||||
|
gnupg dirmngr \
|
||||||
; \
|
; \
|
||||||
rm -rf /var/lib/apt/lists/*;
|
rm -rf /var/lib/apt/lists/*;
|
||||||
|
|
||||||
|
# Add tini for reaping processes
|
||||||
|
ENV TINI_VERSION v%%TINI_VERSION%%
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /sbin/tini
|
||||||
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini.asc /tini.asc
|
||||||
|
RUN gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
|
||||||
|
&& gpg --batch --verify /tini.asc /sbin/tini \
|
||||||
|
&& chmod +x /sbin/tini
|
||||||
|
|
||||||
# install the PHP extensions we need
|
# install the PHP extensions we need
|
||||||
# see https://friendi.ca/resources/requirements/
|
# see https://friendi.ca/resources/requirements/
|
||||||
RUN set -ex; \
|
RUN set -ex; \
|
||||||
|
|
|
@ -7,7 +7,7 @@ done
|
||||||
|
|
||||||
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
echo "Waiting for MySQL $MYSQL_HOST initialization..."
|
||||||
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
if php /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then
|
||||||
php /var/www/html/bin/daemon.php -f start
|
exec /sbin/tini -- php /var/www/html/bin/daemon.php -f start
|
||||||
else
|
else
|
||||||
echo "[ERROR] Waited 300 seconds, no response" >&2
|
echo "[ERROR] Waited 300 seconds, no response" >&2
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -28,6 +28,9 @@ declare -A entrypoints=(
|
||||||
[develop]='entrypoint-dev.sh'
|
[develop]='entrypoint-dev.sh'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Only for debian variant
|
||||||
|
tini_version="0.18.0"
|
||||||
|
|
||||||
apcu_version="$(
|
apcu_version="$(
|
||||||
git ls-remote --tags https://github.com/krakjoe/apcu.git \
|
git ls-remote --tags https://github.com/krakjoe/apcu.git \
|
||||||
| cut -d/ -f3 \
|
| cut -d/ -f3 \
|
||||||
|
@ -122,6 +125,7 @@ function create_variant() {
|
||||||
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
|
s/%%MEMCACHED_VERSION%%/'"${pecl_versions[memcached]}"'/g;
|
||||||
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
|
s/%%REDIS_VERSION%%/'"${pecl_versions[redis]}"'/g;
|
||||||
s/%%ENTRYPOINT%%/'"${entrypoints[$install_type]}"'/g;
|
s/%%ENTRYPOINT%%/'"${entrypoints[$install_type]}"'/g;
|
||||||
|
s/%%TINI_VERSION%%/'"${tini_version}"'/g;
|
||||||
' "$dir/Dockerfile"
|
' "$dir/Dockerfile"
|
||||||
|
|
||||||
for name in entrypoint cron; do
|
for name in entrypoint cron; do
|
||||||
|
@ -162,4 +166,4 @@ echo "$travisAmd64" > .travis.yml
|
||||||
|
|
||||||
travisFull="$(awk -v 'RS=\n\n' '$1 == "-" && $2 == "stage:" && $3 == "test" && $4 == "images" && $5 == "(full)" { $0 = " - stage: test images (full)'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
|
travisFull="$(awk -v 'RS=\n\n' '$1 == "-" && $2 == "stage:" && $3 == "test" && $4 == "images" && $5 == "(full)" { $0 = " - stage: test images (full)'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
|
||||||
|
|
||||||
echo "$travisFull" > .travis.yml
|
echo "$travisFull" > .travis.yml
|
||||||
|
|
Loading…
Reference in a new issue