diff --git a/guides/deployment/releases.md b/guides/deployment/releases.md index 7e4d1668fa..2d9a288871 100644 --- a/guides/deployment/releases.md +++ b/guides/deployment/releases.md @@ -181,8 +181,8 @@ ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}" FROM ${BUILDER_IMAGE} AS builder # install build dependencies -RUN apt-get update -y && apt-get install -y build-essential git \ - && apt-get clean && rm -f /var/lib/apt/lists/*_* +RUN apt-get update && apt-get install -y --no-install-recommends build-essential git \ + && rm -rf /var/lib/apt/lists/* # prepare build dir WORKDIR /app @@ -227,9 +227,9 @@ RUN mix release # the compiled release and other runtime necessities FROM ${RUNNER_IMAGE} -RUN apt-get update -y && \ - apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates \ - && apt-get clean && rm -f /var/lib/apt/lists/*_* +RUN apt-get update && \ + apt-get install -y --no-install-recommends libstdc++6 openssl libncurses5 locales ca-certificates \ + && rm -rf /var/lib/apt/lists/* # Set the locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen diff --git a/priv/templates/phx.gen.release/Dockerfile.eex b/priv/templates/phx.gen.release/Dockerfile.eex index 3792821c8d..af5a380ff0 100644 --- a/priv/templates/phx.gen.release/Dockerfile.eex +++ b/priv/templates/phx.gen.release/Dockerfile.eex @@ -21,8 +21,8 @@ ARG RUNNER_IMAGE="docker.io/debian:${DEBIAN_VERSION}" FROM ${BUILDER_IMAGE} AS builder # install build dependencies -RUN apt-get update -y && apt-get install -y build-essential git \ - && apt-get clean && rm -f /var/lib/apt/lists/*_* +RUN apt-get update && apt-get install -y --no-install-recommends build-essential git \ + && rm -rf /var/lib/apt/lists/* # prepare build dir WORKDIR /app @@ -69,9 +69,9 @@ RUN mix release # the compiled release and other runtime necessities FROM ${RUNNER_IMAGE} -RUN apt-get update -y && \ - apt-get install -y libstdc++6 openssl libncurses5 locales ca-certificates \ - && apt-get clean && rm -f /var/lib/apt/lists/*_* +RUN apt-get update && \ + apt-get install -y --no-install-recommends libstdc++6 openssl libncurses5 locales ca-certificates \ + && rm -rf /var/lib/apt/lists/* # Set the locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen