【问题标题】:docker context create ecs myecs - requires exactly one argumentdocker context create ecs myecs - 只需要一个参数
【发布时间】:2021-07-18 01:00:53
【问题描述】:

我正在尝试创建一个将自动与 AWS 的 ECS 集成的 Docker 上下文。 I'm following this tutorial

作者只是这样做: docker context create ecs myecs 并得到一个“选择一个集成”提示,而我得到一个错误,说它只需要 1 个参数。

docker context create" requires exactly 1 argument.
See 'docker context create --help'.

Usage:  docker context create [OPTIONS] CONTEXT

Create a context

【问题讨论】:

    标签: amazon-web-services docker amazon-ecs


    【解决方案1】:

    这里是博客/教程的作者。看起来您没有安装 pre-requsite。在博客中,我以这样的方式调用了 pre-req。

    ....In July, Docker released a beta for Docker Desktop that embedded these functionalities and, on September 15th, Docker released an updated experience in their Docker Desktop stable channel....

    然后

    ...For now the only thing you need is Docker Desktop and an AWS account. For this test , I am using Docker Desktop (stable) version 2.5.0.1....

    最后

    The core of this integration is built around a new tool dubbed Compose CLI (this is not to be confused with the original docker-compose CLI). This new CLI surfaces to the user as new functionalities in the docker command. While in Docker Desktop all this plumbing is completely hidden and available out of the box, if you are using a Linux machine you can set it up using either a script or a manual install. This new CLI is, essentially, a new version of the docker binary.

    渴望更多地了解我们如何才能更清楚地/正面和中心地说明需要安装的东西和/或您必须使用的最低软件版本。

    感谢您试用!

    【讨论】:

      【解决方案2】:

      您需要安装 Docker Compose CLI 预览版

      下面的 curl 来自这里:Docker docs

      1. curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh
        
      2. sudo docker context create ecs myecs
        

      出于某种原因,没有 sudo 对我来说它不起作用。

      脚本完成后,我遇到了一些奇怪的错误: cp: cannot stat '/tmp/tmp.d4QjhW8T6k/docker-compose': No such file or directorydocker context create ecs myecs 起初不起作用,但一旦我尝试使用 sudo,它就可以正常工作。

      编辑:. ~/.zshrc(或者只是关闭您的终端并打开一个新终端)使我可以在没有 sudo 的情况下运行 docker context create ecs myecs

      【讨论】:

      • 它仅适用于 sudo,因为安装脚本会下载 /usr/local/bin 中的 docker 可执行文件,而您可能已经在 /usr/bin 中拥有另一个 docker 可执行文件。如果您尝试使用/usr/local/bin/docker context ...,它将起作用。
      猜你喜欢
      • 2023-03-16
      • 1970-01-01
      • 2021-02-06
      • 2021-08-18
      • 1970-01-01
      • 2021-07-17
      • 2018-06-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多