From 4584d3b4b85c34d096d2b22af5eb0d8bf43e6862 Mon Sep 17 00:00:00 2001 From: Elvis Souza Date: Fri, 23 Aug 2019 00:04:33 -0300 Subject: [PATCH] Optimize docker image build (#153) --- Dockerfile.arm7x86 | 2 +- Dockerfile.arm8x64 | 2 +- Dockerfile.hub | 14 ++++++++------ RELEASE-NOTES.md | 3 +++ VERSION | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Dockerfile.arm7x86 b/Dockerfile.arm7x86 index 4e758a2a4..d75851148 100644 --- a/Dockerfile.arm7x86 +++ b/Dockerfile.arm7x86 @@ -3,4 +3,4 @@ ADD build/dns-proxy-server-linux-arm-*.tgz /app/ WORKDIR /app LABEL dps.container=true VOLUME ["/var/run/docker.sock", "/var/run/docker.sock"] -CMD ["bash", "-c", "/app/dns-proxy-server"] +ENTRYPOINT ["/app/dns-proxy-server"] diff --git a/Dockerfile.arm8x64 b/Dockerfile.arm8x64 index 0500df5f8..ba7862600 100644 --- a/Dockerfile.arm8x64 +++ b/Dockerfile.arm8x64 @@ -3,4 +3,4 @@ ADD build/dns-proxy-server-linux-arm64-*.tgz /app/ WORKDIR /app LABEL dps.container=true VOLUME ["/var/run/docker.sock", "/var/run/docker.sock"] -CMD ["bash", "-c", "/app/dns-proxy-server"] +ENTRYPOINT ["/app/dns-proxy-server"] diff --git a/Dockerfile.hub b/Dockerfile.hub index ff90086f5..1d88afce9 100644 --- a/Dockerfile.hub +++ b/Dockerfile.hub @@ -1,10 +1,12 @@ -FROM debian:10-slim -WORKDIR /app +FROM debian:10-slim AS BUILDER ENV TMP_NAME=/tmp/dns-proxy-server.tgz -RUN apt-get update && apt-get install --force-yes -y curl &&\ +RUN apt-get update && apt-get install -y curl &&\ curl -L https://github.com/mageddo/dns-proxy-server/releases/download/2.17.2/dns-proxy-server-linux-amd64-2.17.2.tgz > $TMP_NAME && \ - tar -xvf $TMP_NAME -C /app/ &&\ - rm -r /tmp && apt-get purge -y curl && apt-get clean + mkdir /app && tar -xvf $TMP_NAME -C /app + +FROM debian:10-slim LABEL dps.container=true +WORKDIR /app +COPY --from=BUILDER /app /app VOLUME ["/var/run/docker.sock", "/var/run/docker.sock"] -CMD ["bash", "-c", "/app/dns-proxy-server"] +ENTRYPOINT ["/app/dns-proxy-server"] diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 1db93f153..510bfa7a4 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -1,3 +1,6 @@ +### 2.17.3 +* Separating the build image from final image, removing unnecessary bash command + ### 2.17.2 * Fixing docker build was using deprecated apt-get option diff --git a/VERSION b/VERSION index 94dc0ec91..15d0fc4cf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.17.2 +2.17.3