0

When running docker build on my Dockerfile, I pull the most up to date code from a private gitlab repo using a FROM gitlab statment. I am getting a access forbidden error as I have not given my credentials. How do you give your credentials so that I can pull from this private repo?

1 Answer 1

1

(Assuming you are talking about Gitlab Container Registry)

To be able to pull docker images from private registries, you need to first run this at the command line:

$ docker login -u $DOCKER_USER -p $DOCKER_PASS

If you are running this in a CI environment, you should set these as secret environment variables.

With Gitlab, I believe it is something along these lines:

$ docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.example.com

See the above linked page (search for "login") to see more examples and instructions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.