如何从GitLab容器注册表将Docker容器部署到Azure App Service

时间:2020-05-27 11:56:14

标签: azure docker gitlab azure-container-service

我在GitLab上托管了一个应用程序,并设置了GitLab CI来构建我的docker映像并将其推送到GitLab Container注册表中。现在,我想将该容器映像部署到Azure App Service中而不使用Azure容器注册表(我不想拥有另一个注册表)。这有可能吗?

谢谢

编辑:

我尝试过这种方法,但是它不起作用。 enter image description here

出现此错误:

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.

当我连接到gitlab网站时,我使用的用户名和密码有效。似乎正在尝试使用Docker集线器而不是GitLab拉取映像。

1 个答案:

答案 0 :(得分:0)

您可以这样做,您需要在appservice中选择私有容器注册表,然后传递凭据

确保传递图像注册表的全名Registry.gitlab.com //

enter image description here