【问题标题】:Error Define and run multi-container applications with Docker使用 Docker 定义和运行多容器应用程序时出错
【发布时间】:2019-01-28 19:53:01
【问题描述】:

我使用的是 dotnet core 2.1.3,Docker 版本 17.06.0-ce。 当我在 Visual Studio 2017 中运行应用程序时遇到问题,

**Error---Define and run multi-container applications with Docker.**
Usage:
  docker-compose [-f <arg>...] [options] [COMMAND] [ARGS...]
  docker-compose -h|--help

Options:
  -f, --file FILE             Specify an alternate compose file (default: docker-compose.yml)
  -p, --project-name NAME     Specify an alternate project name (default: directory name)
  --verbose                   Show more output
  -v, --version               Print version and exit
  -H, --host HOST             Daemon socket to connect to
  --tls                       Use TLS; implied by --tlsverify
  --tlscacert CA_PATH         Trust certs signed only by this CA
  --tlscert CLIENT_CERT_PATH  Path to TLS certificate file
  --tlskey TLS_KEY_PATH       Path to TLS key file
  --tlsverify                 Use TLS and verify the remote
  --skip-hostname-check       Don't check the daemon's hostname against the name specified
                              in the client certificate (for example if your docker host
                              is an IP address)
  --project-directory PATH    Specify an alternate working directory
                              (default: the path of the Compose file)

docker -compose.yml 文件包含 版本:'3.4'

服务: 霍姆斯: 图片:霍姆斯 建造: 上下文:./HOMS dockerfile: Dockerfile

如需更多疑难解答信息,请转至http://aka.ms/DockerToolsTroubleshootingdocker-compose C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.Docker.Sdk\build\Microsoft.VisualStudio.Docker .Compose.targets 195 5

提前致谢

【问题讨论】:

  • 你实际运行的是什么命令?你有没有像docker-compose.yml 这样的源代码可以添加到问题中?如果您只运行不带参数的docker-compose,这看起来就像您得到的输出(不是错误本身,只是一条长帮助消息)。
  • 感谢您的回复,在visual studio中运行应用程序,我没有使用任何命令,只需单击运行按钮。并且 docker -compose.yml 文件包含版本:'3.4' 服务:homs: image: homs build: context: ./HOMS dockerfile: Dockerfile
  • 有解决办法吗?

标签: docker .net-core


【解决方案1】:

你需要安装 docker compose。

https://docs.docker.com/compose/install/

【讨论】:

    【解决方案2】:
    1. 检查您是否安装了 docker compose? https://docs.docker.com/compose/install/
    2. 然后运行docker-compose up

    【讨论】:

      【解决方案3】:

      为了帮助其他人,我发现错误也是由不正确的cmd行引起的。对我来说,我错误地指定了-up - 我不想告诉你我看了多少次我确信是正确的。!

      我希望有人觉得这很有帮助 - 在寻找更复杂的问题原因时,很容易犯简单的错误并忽略它们。

      【讨论】:

        猜你喜欢
        • 2022-08-16
        • 2019-01-01
        • 2016-11-06
        • 2021-11-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-07-16
        • 2020-02-19
        相关资源
        最近更新 更多