1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-29 02:54:55 +02:00

[Dockerfiles] Rename some files and create hook points

This commit is contained in:
andryyy 2019-10-18 12:01:47 +02:00
parent b02f73e68e
commit b0711db489
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
17 changed files with 53 additions and 13 deletions

View File

@ -17,7 +17,7 @@ RUN apk upgrade --no-cache \
&& python3 -m pip install --upgrade pip \
&& python3 -m pip install acme-tiny
COPY docker-entrypoint.sh /srv/docker-entrypoint.sh
COPY acme.sh /srv/acme.sh
COPY expand6.sh /srv/expand6.sh
CMD ["/sbin/tini", "-g", "--", "/srv/docker-entrypoint.sh"]
CMD ["/sbin/tini", "-g", "--", "/srv/acme.sh"]

View File

@ -55,7 +55,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& adduser --system --no-create-home --home /var/lib/clamav --uid 700 --gid 700 --disabled-login clamav \
&& rm -rf /tmp/* /var/tmp/*
COPY bootstrap.sh ./
COPY clamd.sh ./
COPY tini /sbin/tini
CMD ["/sbin/tini", "-g", "--", "/bootstrap.sh"]
CMD ["/sbin/tini", "-g", "--", "/clamd.sh"]

View File

@ -7,6 +7,6 @@ RUN apk add --update --no-cache python3 openssl tzdata \
&& pip3 install --upgrade pip \
&& pip3 install --upgrade docker flask flask-restful
COPY server.py /app/
COPY dockerapi.py /app/
CMD ["python3", "-u", "/app/server.py"]
CMD ["python3", "-u", "/app/dockerapi.py"]

View File

@ -260,4 +260,12 @@ fi
# Collect SA rules once now
/usr/local/bin/sa-rules.sh
# Run hooks
for file in /hooks/*; do
if [ -x "${file}" ]; then
echo "Running hook ${file}"
"${file}"
fi
done
exec "$@"

View File

@ -85,4 +85,5 @@ RUN apk add -U --no-cache autoconf \
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["php-fpm"]

View File

@ -123,4 +123,12 @@ EOF
fi
fi
# Run hooks
for file in /hooks/*; do
if [ -x "${file}" ]; then
echo "Running hook ${file}"
"${file}"
fi
done
exec "$@"

View File

@ -34,4 +34,12 @@ chown -R _rspamd:_rspamd /var/lib/rspamd \
/etc/rspamd/rspamd.conf.override \
/etc/rspamd/plugins.d
# Run hooks
for file in /hooks/*; do
if [ -x "${file}" ]; then
echo "Running hook ${file}"
"${file}"
fi
done
exec "$@"

View File

@ -4,7 +4,7 @@ USER root
ENV GOSU_VERSION 1.11
COPY docker-entrypoint.sh /
COPY solr.sh /
COPY solr-config-7.7.0.xml /
COPY solr-schema-7.7.0.xml /
@ -18,8 +18,8 @@ RUN dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
bash \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /docker-entrypoint.sh \
&& chmod +x /solr.sh \
&& sync \
&& bash /docker-entrypoint.sh --bootstrap
&& bash /solr.sh --bootstrap
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/solr.sh"]

View File

@ -19,3 +19,5 @@ EXPOSE 53/udp 53/tcp
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/unbound"]

View File

@ -8,4 +8,13 @@ echo "Receiving anchor key..."
echo "Receiving root hints..."
curl -#o /etc/unbound/root.hints https://www.internic.net/domain/named.cache
/usr/sbin/unbound-control-setup
# Run hooks
for file in /hooks/*; do
if [ -x "${file}" ]; then
echo "Running hook ${file}"
"${file}"
fi
done
exec "$@"

View File

@ -34,7 +34,4 @@ RUN apk add --update \
COPY watchdog.sh /watchdog.sh
#ENTRYPOINT ["/sbin/tini", "-g", "--"]
# Less verbose
CMD /watchdog.sh 2> /dev/null

3
data/hooks/README.md Normal file
View File

@ -0,0 +1,3 @@
Place executable scripts in each directory to run a hook at the end of a docker-entrypoint.sh script.
Only images with a docker-entrypoint are covered.

4
data/hooks/dovecot/test.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
echo blabla
echo dasdasd