From a5f38cc6d511e93d1004ec1d58aea494247541a3 Mon Sep 17 00:00:00 2001 From: Peter Schiffer Date: Thu, 22 Nov 2018 19:45:43 +0100 Subject: [PATCH] Migrate docker-cmd.sh to entrypoint --- pdns-admin-uwsgi-ngoduykhanh/Dockerfile | 7 ++++--- .../{docker-cmd.sh => docker-entrypoint.sh} | 2 +- pdns-recursor/Dockerfile | 6 ++++-- pdns-recursor/Dockerfile.alpine | 6 ++++-- pdns-recursor/{docker-cmd.sh => docker-entrypoint.sh} | 2 +- pdns/Dockerfile | 6 ++++-- pdns/Dockerfile.alpine | 6 ++++-- pdns/{docker-cmd.sh => docker-entrypoint.sh} | 2 +- 8 files changed, 23 insertions(+), 14 deletions(-) rename pdns-admin-uwsgi-ngoduykhanh/{docker-cmd.sh => docker-entrypoint.sh} (98%) rename pdns-recursor/{docker-cmd.sh => docker-entrypoint.sh} (95%) rename pdns/{docker-cmd.sh => docker-entrypoint.sh} (98%) diff --git a/pdns-admin-uwsgi-ngoduykhanh/Dockerfile b/pdns-admin-uwsgi-ngoduykhanh/Dockerfile index 277ea8e..61fe837 100644 --- a/pdns-admin-uwsgi-ngoduykhanh/Dockerfile +++ b/pdns-admin-uwsgi-ngoduykhanh/Dockerfile @@ -6,13 +6,14 @@ RUN dnf -y --setopt=install_weak_deps=False install \ uwsgi-plugin-python3 \ && dnf clean all -COPY docker-cmd.sh / - EXPOSE 9494 VOLUME [ "/opt/powerdns-admin/upload" ] +COPY docker-entrypoint.sh / COPY pdns-admin.ini /etc/uwsgi.d/ RUN chown uwsgi: /etc/uwsgi.d/pdns-admin.ini -CMD [ "/docker-cmd.sh" ] +ENTRYPOINT [ "/docker-entrypoint.sh" ] + +CMD [ "/usr/sbin/uwsgi", "--ini", "/etc/uwsgi.ini" ] diff --git a/pdns-admin-uwsgi-ngoduykhanh/docker-cmd.sh b/pdns-admin-uwsgi-ngoduykhanh/docker-entrypoint.sh similarity index 98% rename from pdns-admin-uwsgi-ngoduykhanh/docker-cmd.sh rename to pdns-admin-uwsgi-ngoduykhanh/docker-entrypoint.sh index 82775a3..5c62ae7 100755 --- a/pdns-admin-uwsgi-ngoduykhanh/docker-cmd.sh +++ b/pdns-admin-uwsgi-ngoduykhanh/docker-entrypoint.sh @@ -52,4 +52,4 @@ $MYSQL_COMMAND ${PDNS_ADMIN_SQLA_DB_NAME//\'/} -e "UPDATE setting SET value='${P mkdir -p /run/uwsgi chown uwsgi: /run/uwsgi -exec /usr/sbin/uwsgi --ini /etc/uwsgi.ini +exec "$@" diff --git a/pdns-recursor/Dockerfile b/pdns-recursor/Dockerfile index 788bbc4..e26455e 100644 --- a/pdns-recursor/Dockerfile +++ b/pdns-recursor/Dockerfile @@ -18,6 +18,8 @@ ENV VERSION=4.1 \ EXPOSE 53 53/udp COPY recursor.conf.tpl / -COPY docker-cmd.sh / +COPY docker-entrypoint.sh / -CMD [ "/docker-cmd.sh" ] +ENTRYPOINT [ "/docker-entrypoint.sh" ] + +CMD [ "/usr/sbin/pdns_recursor" ] diff --git a/pdns-recursor/Dockerfile.alpine b/pdns-recursor/Dockerfile.alpine index 8fbe08f..6256977 100644 --- a/pdns-recursor/Dockerfile.alpine +++ b/pdns-recursor/Dockerfile.alpine @@ -18,6 +18,8 @@ ENV VERSION=4.1 \ EXPOSE 53 53/udp COPY recursor.conf.tpl / -COPY docker-cmd.sh / +COPY docker-entrypoint.sh / -CMD [ "/docker-cmd.sh" ] +ENTRYPOINT [ "/docker-entrypoint.sh" ] + +CMD [ "/usr/sbin/pdns_recursor" ] diff --git a/pdns-recursor/docker-cmd.sh b/pdns-recursor/docker-entrypoint.sh similarity index 95% rename from pdns-recursor/docker-cmd.sh rename to pdns-recursor/docker-entrypoint.sh index 37a1b53..c0dfdc4 100755 --- a/pdns-recursor/docker-cmd.sh +++ b/pdns-recursor/docker-entrypoint.sh @@ -23,4 +23,4 @@ envtpl < /recursor.conf.tpl > $config_file # Fix config file ownership chown ${pdns_user}: $config_file -exec /usr/sbin/pdns_recursor +exec "$@" diff --git a/pdns/Dockerfile b/pdns/Dockerfile index 007c046..e1c3fa1 100644 --- a/pdns/Dockerfile +++ b/pdns/Dockerfile @@ -19,6 +19,8 @@ ENV VERSION=4.1 \ EXPOSE 53 53/udp COPY pdns.conf.tpl / -COPY docker-cmd.sh / +COPY docker-entrypoint.sh / -CMD [ "/docker-cmd.sh" ] +ENTRYPOINT [ "/docker-entrypoint.sh" ] + +CMD [ "/usr/sbin/pdns_server" ] diff --git a/pdns/Dockerfile.alpine b/pdns/Dockerfile.alpine index b142daf..850fced 100644 --- a/pdns/Dockerfile.alpine +++ b/pdns/Dockerfile.alpine @@ -19,6 +19,8 @@ ENV VERSION=4.1 \ EXPOSE 53 53/udp COPY pdns.conf.tpl / -COPY docker-cmd.sh / +COPY docker-entrypoint.sh / -CMD [ "/docker-cmd.sh" ] +ENTRYPOINT [ "/docker-entrypoint.sh" ] + +CMD [ "/usr/sbin/pdns_server" ] diff --git a/pdns/docker-cmd.sh b/pdns/docker-entrypoint.sh similarity index 98% rename from pdns/docker-cmd.sh rename to pdns/docker-entrypoint.sh index 6d7ed71..59e51c1 100755 --- a/pdns/docker-cmd.sh +++ b/pdns/docker-entrypoint.sh @@ -43,4 +43,4 @@ if [ "${SUPERMASTER_IPS:-}" ]; then $MYSQL_COMMAND -D "$PDNS_gmysql_dbname" -e "$MYSQL_INSERT_SUPERMASTERS" fi -exec /usr/sbin/pdns_server +exec "$@"