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

Time:08-24

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.

CodePudding user response:

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.

  • Related