【问题标题】:Docker Compose Failure in Azure App Service Environment (ASEv3)Azure 应用服务环境 (ASEv3) 中的 Docker Compose 失败
【发布时间】:2021-12-08 13:28:31
【问题描述】:

在应用服务环境下的 Azure 应用服务中,我使用公共 Docker Hub 作为注册表源配置了 Docker Compose 设置。

version: '3.7'
services:
  web:
    image: nginx:stable
    restart: always
    ports:
      - '80:80'

不幸的是,这未能部署,检查日志,我看到的输出很少:

2021-10-21T19:14:55.647Z INFO - Stopping site XXXX-as__6e65 because it failed during startup. 
2021-10-21T19:15:02.054Z INFO - Stopping site XXXX-as__6e65 because it failed during startup. 
2021-10-21T19:15:11.990Z INFO - Stopping site XXXX-as__6e65 because it failed during startup. 
2021-10-21T19:15:28.110Z INFO - Stopping site XXXX-as__6e65 because it failed during startup. 
2021-10-21T19:17:39.825Z INFO - Stopping site XXXX-as__6e65 because it failed during startup.

我会注意到,迁移到单个容器设置(而不是 Docker Compose 设置)可以正常工作。

【问题讨论】:

    标签: azure-web-app-service azure-app-service-envrmnt


    【解决方案1】:

    以下是一些需要设置的组合文件:

    services:
      web:
        image: nginx
        deploy:
          restart_policy:
            condition: on-failure
        healthcheck:
          test: ["CMD", "curl", "-f", "http://localhost:80"]
          interval: 10s
    

    您还可以使用 docker compose 命令将 Compose 文件中定义的多容器应用程序部署和管理到 ACI。同一个 Compose 应用程序中的所有容器都在同一个容器组中启动。容器之间的服务发现使用 Compose 文件中指定的服务名称工作。容器之间的名称解析是通过在/etc/hosts 文件中写入服务名称来实现的,该文件由容器组中的所有容器自动共享。

    我们有一个很好的博客与此相关,请参考,感谢docs.dockers

    【讨论】:

      猜你喜欢
      • 2019-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多