6

I only found instructions on how to run a container and mount a volume at the same time:

$ sudo docker run -d -P --name web -v /src/webapp:/opt/webapp training/webapp python app.py

Taken from the user guide.

But I don't know the command to run once the container is running.

Lay González
  • 175
  • 1
  • 7

1 Answers1

4

This is not possible with the current version of docker. All volumes, links, networking, etc. need to be configured when the container starts.

Follow this docker pull request for when this functionality may end up being merged.

EEAA
  • 108,414
  • 18
  • 172
  • 242
  • I'm not sure this feature will actually fit the author's need. This is more like an implementation of [centralized volume management](https://github.com/docker/docker/issues/8363) than volume hotplug/unplug. – Xavier Lucas Mar 03 '15 at 22:14
  • Just a nitpick: networking can be configured on running containers (e.g. attaching a running container to a network you just created) – Laurens Rietveld Jan 06 '17 at 10:39