From b765d6d6cee31285d727dfe18746ca62bbeecc2f Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Tue, 17 Feb 2026 16:59:27 -0600 Subject: [PATCH] fix: install hex/rebar inside cache-mounted RUN steps in Dockerfile The --mount=type=cache,target=/root/.mix overlays shadow the hex installation done in the prior non-cached RUN step. With a cold cache the hex archive is absent, causing 'Could not find an SCM for dependency' errors. Install hex and rebar inside each cache-mounted step instead. --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8e4af904..e63181b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,6 +46,8 @@ COPY mix.exs mix.lock ./ COPY vendor vendor RUN --mount=type=cache,target=/root/.hex \ --mount=type=cache,target=/root/.mix \ + mix local.hex --force && \ + mix local.rebar --force && \ mix deps.get --only $MIX_ENV RUN mkdir config @@ -55,6 +57,8 @@ RUN mkdir config COPY config/config.exs config/${MIX_ENV}.exs config/ RUN --mount=type=cache,target=/root/.hex \ --mount=type=cache,target=/root/.mix \ + mix local.hex --force && \ + mix local.rebar --force && \ mix deps.compile RUN --mount=type=cache,target=/root/.mix \