我正在尝试使用 VSTS 和 docker-compose 配置持续交付,我想将其推送到 Azure 容器注册表。这是我在 VSTS 上的构建定义:

我收到关于构建结果的错误消息:
No such command: docker_compose
Commands:
build Build or rebuild services
bundle Generate a Docker bundle from the Compose file
config Validate and view the Compose file
create Create services
down Stop and remove containers, networks, images, and volumes
events Receive real time events from containers
exec Execute a command in a running container
help Get help on a command
Run Code Online (Sandbox Code Playgroud)
你知道我该怎么处理吗?
更新:这是我的 docker-compose
version: '3'
services:
ci-build:
image: microsoft/aspnetcore-build:1.0-1.1
volumes:
- …Run Code Online (Sandbox Code Playgroud) docker docker-compose azure-devops azure-pipelines-build-task azure-container-registry
有没有一种方法可以使用REST API在Azure容器注册表中操作图像(删除,重新标记等)?现有问题的答案仅提及CLI。
我正在 Azure DevOps 管道中构建 docker 映像,然后我想将它推送到 Azure 容器注册表。注册表已经创建,我已经配置了 DevOps 来使用它,buildAndPushDocker 任务也可以工作。
但是,由于可以对 Docker 构建进行参数化,因此我想将参数传递给它,而我无法使用buildAndPushDocker 任务来实现。所以我决定分两步做,一个是构建,另一个是推动。这边走:
# Docker
# Build and push an image to Azure Container Registry
# https://docs.microsoft.com/azure/devops/pipelines/languages/docker
trigger: none
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'aaaa-aaaa-aaaa-aaaa-aaaaa'
imageRepository: 'ubuntu-qt'
containerRegistry: 'myregistry.azurecr.io'
dockerfilePath: '$(Build.SourcesDirectory)/docker-qt-build/Dockerfile'
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: BuildPush
displayName: Build and push
jobs:
- job: Build
displayName: …Run Code Online (Sandbox Code Playgroud) docker azure-devops azure-pipelines azure-container-registry
我是 Azure 订阅的共同管理员(所有者)。当我尝试在 azure devops 中创建到 Azure continer resitry 的新服务连接时,我收到以下错误“未找到注册表”
我已经自定义了 coredns 映像并将其推送到我的 azure 容器注册表 (ACR)。
现在,在安装 k3s 之后出现的默认 coredns pod 中,我想使用my_azure_acr_repo/proj/customize-coredns:latestimage而不是 rancher/coredns-coredns:1.8.3. 因此,我编辑了 coredns 部署kubectl edit deploy coredns -n kube-system,并将我的 acr 映像替换为 rancher one。但现在 coredns pod 无法提取我的 acr 映像并在 pod 描述中给出错误:
Failed to pull image "my_azure_acr_repo/proj/customize-coredns:latest": rpc error:
code = Unknown desc = failed to pull and unpack image "my_azure_acr_repo/proj/customize-coredns:latest":
failed to resolve reference "my_azure_acr_repo/proj/customize-coredns:latest": failed to
authorize: failed to fetch anonymous token: unexpected status: 401 Unauthorized
Run Code Online (Sandbox Code Playgroud)
如何验证 acr 映像,以便 pod 拉取它?