如何从GitLab容器注册表将Docker容器部署到Azure应用服务上

问题描述 投票:0回答:1

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

谢谢,谢谢

EDIT:

我试过了,但没有用。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 hub来拉取镜像,而不是GitLab。

azure docker gitlab azure-container-service
1个回答
0
投票

你可以做到这一点,你需要在应用程序服务中选择私人容器注册表,然后传递凭证。

确保您传递的是图像注册表的全名 registry.gitlab.com/。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.