Improvements on Dockerfile.release

* Change image to docker.io/library/debian:bullseye-slim (Slim variant
  with complete path to allow easier fetch for podman/oci-like container
  systems)
* Rebuilt instalation procedure to avoid unnecessary packages and trash
  like caches and packages that aren't used.
* Removed unecessary layers (Since ALL layers are pulled when user
  fetches the image) to decrease docker image size.
This commit is contained in:
Leonardo Amaral 2023-04-12 19:08:52 -03:00
parent 7f63d896f9
commit d3cbde43c7
No known key found for this signature in database

View file

@ -1,23 +1,22 @@
# vim: ft=dockerfile
FROM debian:bullseye
FROM docker.io/library/debian:bullseye-slim
ARG VERSION
RUN apt-get update -qq && apt-get install curl gpg -y
RUN mkdir -p /usr/share/zerotier && \
curl -o /usr/share/zerotier/tmp.asc "https://download.zerotier.com/contact%40zerotier.com.gpg" && \
gpg --no-default-keyring --keyring /usr/share/zerotier/zerotier.gpg --import /usr/share/zerotier/tmp.asc && \
rm -f /usr/share/zerotier/tmp.asc && \
echo "deb [signed-by=/usr/share/zerotier/zerotier.gpg] http://download.zerotier.com/debian/bullseye bullseye main" > /etc/apt/sources.list.d/zerotier.list
RUN apt-get update -qq && apt-get install zerotier-one=${VERSION} curl iproute2 net-tools iputils-ping openssl libssl1.1 -y
RUN rm -rf /var/lib/zerotier-one
COPY entrypoint.sh.release /entrypoint.sh
RUN chmod 755 /entrypoint.sh
RUN apt -y update \
&& apt -y -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 install ca-certificates curl gpg \
&& curl -sSL "https://download.zerotier.com/contact%40zerotier.com.gpg" | gpg --dearmor > /etc/apt/trusted.gpg.d/zerotier.gpg \
&& echo "deb http://download.zerotier.com/debian/bullseye bullseye main" > /etc/apt/sources.list.d/zerotier.list \
&& apt -y update \
&& apt -y install zerotier-one=${VERSION} \
&& apt -y -o APT::Install-Suggests=0 -o APT::Install-Recommends=0 install iproute2 net-tools iputils-ping \
&& apt -y purge ca-certificates curl gpg gpgconf \
&& chmod 755 /entrypoint.sh \
&& rm -rf /etc/apt/trusted.gpg.d/zerotier.gpg /var/lib/zerotier-one /var/lib/apt/lists/* /var/cache/apt/*
HEALTHCHECK --interval=1s CMD bash /healthcheck.sh
CMD []
ENTRYPOINT ["/entrypoint.sh"]