0

I need to attach a volume to the running container which has started from the docker run command on my AWS EC2 server (Ubuntu 18.04 LTS) with the following command

$ docker run --name example -p 8080:80 -dt example-image:latest

I'm using Docker version 19.03.12.

Jay Blanchard
  • 34,243
  • 16
  • 77
  • 119
saikrishna
  • 13
  • 4
  • 1
    You have to delete and recreate the container with a new `docker run` command. Note that you need to do this for many other common tasks too (especially running the container with a newer image) and I'd treat this as totally routine. – David Maze Sep 29 '20 at 14:24
  • Look at https://stackoverflow.com/questions/28302178/how-can-i-add-a-volume-to-an-existing-docker-container/56970321#56970321 – droebi Oct 12 '20 at 14:26

0 Answers0