Hello,
I am encountering an issue while trying to fetch Oban packages from a private Hex repository during the Docker build process for my Elixir Phoenix project.
Steps I’ve Taken:
- Verified the repository configuration with
mix hex.repo list
, and the private repo is correctly listed. - Confirmed the OBAN_AUTH_KEY environment variable is set (also printed it within the Dockerfile).
Dockerfile Context:
I’m using the following RUN
command within the Dockerfile to configure the private Hex repository:
dockerfile
RUN --mount=type=secret,id=oban_auth_key \
mix hex.repo add oban https://getoban.pro/repo \
--fetch-public-key SHA256:4/OSKi0NRF91QVVXlGAhb/BIMLnK8NHcx/EWs+aIWPc \
--auth-key "$(cat /run/secrets/oban_auth_key)"
Docker Build Command:
I build the Docker image with:
docker build --secret id=oban_auth_key,env=OBAN_AUTH_KEY .
Error Message:
sql
3.461 remote: Total 9314 (delta 4618), reused 8001 (delta 3786), pack-reused 0 (from 0)
4.943 Failed to fetch record for oban/oban_web from registry (using cache instead)
4.943 unknown or incorrect license key
4.961 ** (Mix) Unknown package oban_web in lockfile