2

I have an application hosted on GitLab and have set the GitLab CI to build my docker image and push it into GitLab Container registry. Now I want to deploy that container image into Azure App Service without using Azure Container Registry (I don't want to have another registry). Is this possible and how?

Thanks

EDIT:

I tried like this and it's not working. enter image description here

With this error:

2020-05-27T14:31:32.739Z INFO  - Pulling image: project1_administration:latest

2020-05-27T14:31:33.098Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://registry-1.docker.io/v2/library/project1_administration/manifests/latest: unauthorized: incorrect username or password"}

2020-05-27T14:31:33.099Z ERROR - Pulling docker image project1_administration:latest failed:

2020-05-27T14:31:33.100Z INFO  - Pulling image from Docker hub: library/project1_administration:latest

2020-05-27T14:31:33.577Z ERROR - DockerApiException: Docker API responded with status code=NotFound, response={"message":"pull access denied for project1_administration, repository does not exist or may require 'docker login': denied: requested access to the resource is denied"}

2020-05-27T14:31:33.580Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)

2020-05-27T14:31:33.586Z INFO  - Stopping site project1test because it failed during startup.

The username and password I used works when I connect to gitlab site. It seems it is trying to use Docker hub to pull the image not the GitLab.

2 Answers 2

3

Assuming that your image is already in the Container Registry in GitLab:

  1. To access your GitLab Registry Images from Azure, the first thing you need to do is create a Deploy Token (under Settings -> Repository). Copy the username and password (you won't be able to access the password again). Ensure the token has read_registry scope.
  2. In Azure, create a Web App for Containers. Under the Docker tab, choose Private Registry.
  3. Set the options as follows:
  • Server URL: https://registry.gitlab.com
  • Username: Username copied from Deploy Token in step 1
  • Password: Password copied from Deploy Token in step 1
  • Image and tag: registry.gitlab.com/<username>/<repo>:latest
Sign up to request clarification or add additional context in comments.

Comments

0

You can do that, You need to choose private container registry in the appservice and then pass the credentials

Make sure you are passing the full name of the image registry registry.gitlab.com//

enter image description here

2 Comments

hmm it seems it's not working for me. I have updated the question
as the error says you have some issues with the configuration it seems

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.