My projects are built/pushed as docker containers (for uniform deployment/handling with apps written in other languages). Everything worked fine, until I added a private repository from our organisation as a dependency.
After having done this in a previous job, I cannot get it to work now
User + Access Token
Previously, we simply had a āmachine userā (normal user account created for the organization) and we then used their username + personal access token.
In our Dockerfile, weād just replace any access to GitHub with basic auth using the service users credentials, something like this:
# Dockerfile
[container setup / install dependencies]
ARG GITHUB_USERNAME
ARG GITHUB_TOKEN
RUN git config --global url."https://$GITHUB_USERNAME:$GITHUB_TOKEN@github.com".insteadOf "https://github.com"
[mix commands]
Now, when passing the GITHUB_USERNAME and GITHUB_TOKEN as arguments to the docker build container, I get the following error:
1.215 remote: Support for password authentication was removed on August 13, 2021.
I am pretty sure I have used this method til summer 23, so I am bit confused.
GitHub Action Parameter
We use the GitHub - docker/build-push-action: GitHub Action to build and push Docker images with Buildx action to build the container. It has a parameter āGIT_AUTH_TOKENā which states:
If you want to authenticate against another private repository, you have to use a secret named
GIT_AUTH_TOKEN
to be able to authenticate against it with Buildx:
however, this lead to:
fatal: could not read Username for āhttps://github.comā: No such device or address
which then lead me to fatal: could not read Username for 'https://github.com': No such device or address Ā· Issue #1112 Ā· docker/build-push-action Ā· GitHub which brought me back to
1.304 remote: Support for password authentication was removed on August 13, 2021.
How?
How do you authorize for private repositories in docker during mix deps.get
?