Lawrence I. Siden
Lawrence I. Siden

Reputation: 9369

docker run not responding to command-line "--mount" and "--name" options

My question might look like a repeat of Docker run mounting volumes but docker inspect has volumes as null, but it does not address my situation. I run a command like

docker run -d my-image --name my-name -v /host/path:/container/path

The container starts without complaint. But when I run docker inspect it shows

"Volumes": null
...
"Name": "/blissful_napier",

So it does not seem to respond to any of the command-line options I passed.

The answer to the linked question has something to do with anonymous volumes. I don't think this is related to my problem.

Upvotes: 0

Views: 62

Answers (1)

Paolo
Paolo

Reputation: 26084

All docker flags must be specified before the image name:

$ docker run -d --name my-name -v /host/path:/container/path my-image

everything that comes after the image name is passed to the entrypoint of the image.

Upvotes: 1

Related Questions