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.
This commit is contained in:
parent
68826dc89b
commit
b765d6d6ce
1 changed files with 4 additions and 0 deletions
|
|
@ -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 \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue