mirror of
https://github.com/friendica/docker
synced 2025-01-06 14:22:19 +01:00
Merge pull request #108 from valvin1/feat/tini-for-cron
Add tini for cron to reap zombie process
This commit is contained in:
commit
b74bef87bc
17 changed files with 81 additions and 11 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
.idea/
|
.idea/
|
||||||
|
*.swp
|
||||||
|
|
|
@ -11,9 +11,20 @@ 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
|
||||||
|
RUN export BUILD_ARCH=$(dpkg-architecture --query DEB_BUILD_ARCH) \
|
||||||
|
&& curl -L -o /sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH} \
|
||||||
|
&& curl -L -o /tini.asc https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH}.asc \
|
||||||
|
&& 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,20 @@ 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
|
||||||
|
RUN export BUILD_ARCH=$(dpkg-architecture --query DEB_BUILD_ARCH) \
|
||||||
|
&& curl -L -o /sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH} \
|
||||||
|
&& curl -L -o /tini.asc https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH}.asc \
|
||||||
|
&& 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,20 @@ 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
|
||||||
|
RUN export BUILD_ARCH=$(dpkg-architecture --query DEB_BUILD_ARCH) \
|
||||||
|
&& curl -L -o /sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH} \
|
||||||
|
&& curl -L -o /tini.asc https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH}.asc \
|
||||||
|
&& 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,20 @@ 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
|
||||||
|
RUN export BUILD_ARCH=$(dpkg-architecture --query DEB_BUILD_ARCH) \
|
||||||
|
&& curl -L -o /sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH} \
|
||||||
|
&& curl -L -o /tini.asc https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH}.asc \
|
||||||
|
&& 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,20 @@ 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%%
|
||||||
|
RUN export BUILD_ARCH=$(dpkg-architecture --query DEB_BUILD_ARCH) \
|
||||||
|
&& curl -L -o /sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH} \
|
||||||
|
&& curl -L -o /tini.asc https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH}.asc \
|
||||||
|
&& 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
|
||||||
|
|
13
update.sh
13
update.sh
|
@ -28,6 +28,16 @@ declare -A entrypoints=(
|
||||||
[develop]='entrypoint-dev.sh'
|
[develop]='entrypoint-dev.sh'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Only for debian variant
|
||||||
|
tini_version="$(
|
||||||
|
git ls-remote --tags https://github.com/krallin/tini.git \
|
||||||
|
| cut -d/ -f3 \
|
||||||
|
| grep -vE -- '.pre' \
|
||||||
|
| sed -E 's/^v//' \
|
||||||
|
| sort -V \
|
||||||
|
| tail -1
|
||||||
|
)"
|
||||||
|
|
||||||
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 +132,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 +173,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