From 5bb1247f375819625d0220cc745bf3fa5087df56 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 7 Apr 2022 14:44:11 +0200 Subject: [PATCH] Put env directly when building docker images Signed-off-by: Thomas Citharel --- docker/multiarch/Dockerfile | 4 +--- docker/production/Dockerfile | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/docker/multiarch/Dockerfile b/docker/multiarch/Dockerfile index 910b1d9a..64db53d1 100644 --- a/docker/multiarch/Dockerfile +++ b/docker/multiarch/Dockerfile @@ -9,8 +9,6 @@ ENV ELIXIR_VERSION latest ENV ERLANG_VERSION latest ENV NODE_VERSION 16 -ENV HEX_MIRROR="https://cdn.jsdelivr.net/hex" - # Install system dependencies RUN apt-get update -yq && apt-get install -yq build-essential cmake postgresql-client git curl gnupg unzip exiftool webp imagemagick gifsicle RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* @@ -34,7 +32,7 @@ WORKDIR /mobilizon # Elixir release RUN source /root/.bashrc && \ - mix deps.get --only prod && \ + HEX_MIRROR="https://cdn.jsdelivr.net/hex" mix deps.get --only prod && \ mix compile && \ mix phx.digest.clean --all && \ mix release --path release/mobilizon && \ diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 4476945b..511934c3 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -14,15 +14,13 @@ RUN yarn install --network-timeout 100000 \ # Then, build the application binary FROM elixir:1.13-alpine AS builder -ENV HEX_MIRROR="https://cdn.jsdelivr.net/hex" - RUN apk add --no-cache build-base git cmake COPY mix.exs mix.lock ./ ENV MIX_ENV=prod RUN mix local.hex --force \ && mix local.rebar --force \ - && mix deps.get + && HEX_MIRROR="https://cdn.jsdelivr.net/hex" mix deps.get COPY lib ./lib COPY priv ./priv