Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: "docker context create" requires exactly 1 argument

I'm trying to deploy an application using docker-compose through Docker Context. I'm using this guide: https://www.docker.com/blog/how-to-deploy-on-remote-docker-hosts-with-docker-compose/

The problem comes when I try to create a context. e.g.: docker context create test --docker "host=ssh://user@remotehost" I get this:

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

This only happens on Windows WSL, on Linux it works flawlessly.

I'm using docker 19.03.8 with Experimental Features enabled.

like image 529
Anonymous Avatar asked Feb 22 '21 18:02

Anonymous


People also ask

What is Docker context?

The docker context command makes it easy to export and import contexts on different machines with the Docker client installed. You can use the docker context export command to export an existing context to a file. This file can later be imported on another machine that has the docker client installed.

Where is the Docker build context?

The build context is the set of files located at the specified PATH or URL. Those files are sent to the Docker daemon during the build so it can use them in the filesystem of the image.

What is Docker endpoint?

An endpoint connects a sandbox to a network. An implementation of an endpoint could be a veth pair, an Open vSwitch internal port, or something similar. An endpoint can belong to only one network but may only belong to one sandbox.

Does Docker context create require more than 1 argument?

"docker context create" requires exactly 1 argument. See 'docker context create --help'. This only happens on Windows WSL, on Linux it works flawlessly. I'm using docker 19.03.8 with Experimental Features enabled. did you resolve this issue in the end?

What permissions do I need to run a docker container with GPU?

GPU support, which relies on EC2 instances to run containers with attached GPU devices, require a few additional permissions: Run the docker context create ecs myecscontext command to create an Amazon ECS Docker context named myecscontext.

How do I start a docker compose application?

Open the docker-compose.yml file in an editor and replace <<username>> with your Docker ID. Next, we need to make sure we are using the local Docker context. Now we can build and start our application using docker-compose.

How do I find the current context of a docker container?

You can identify the current context that will be used for docker commands by the “*” beside the name of the active context. Now let’s create an ACI context that we can run containers with.


Video Answer


1 Answers

It's because of the dash character. Compare the two commands (notice the two dashes before "docker")

Failed command:
docker context create test --docker "host=ssh://user@remotehost"

Successful command:
docker context create test ‐‐docker "host=ssh://user@remotehost"

like image 155
Huajun Zeng Avatar answered Oct 19 '22 11:10

Huajun Zeng