【问题标题】:Azure Devops self-hosted agent with docker带有 docker 的 Azure Devops 自托管代理
【发布时间】:2021-11-14 04:10:51
【问题描述】:

我已经安装了 Azure 自托管代理 (Linux),并且正在关注来自 https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops 的文档。

我已成功安装代理,但是当我运行 Docker Build 任务编译和构建 docker 映像时,我收到错误 Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

在谷歌搜索问题后,似乎下面的代码应该挂载 docker.sock,我应该能够成功构建和推送 docker 映像,但这在 AKS 上不起作用

        volumeMounts:
        - mountPath: /var/run/docker.sock
          name: docker-volume
      volumes:
      - name: docker-volume
        hostPath:
          path: /var/run/docker.sock

有没有人遇到过这样的问题?我正在使用 AzureDevops Docker@2 任务构建,并且代理正在 AKS 1.19.11 上运行

【问题讨论】:

    标签: azure azure-devops azure-pipelines azure-aks azure-pipelines-build-task


    【解决方案1】:

    自 AKS 1.19 起,它使用 containerd 作为容器运行时 - 这意味着您不能再直接在 AKS 中构建 docker 映像。有关详细信息和可能的解决方法,请参阅this 文章。

    总的来说,我发现 VMSS-based self-hosted Agents for Azure DevOps 是基于容器的代理的绝佳替代品。

    【讨论】:

      猜你喜欢
      • 2021-11-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-02-20
      • 2021-05-06
      • 1970-01-01
      • 1970-01-01
      • 2019-11-06
      相关资源
      最近更新 更多