Question

I created an image from a running container, which had a volume mapped at the time, e.g.: -v /home/user/myproject/xyz:/opt/xyz. Now, when I run that image, e.g.: docker run -i -t myimage bash, there is a mount in /opt/xyz. There isn't any files in it, but I cannot delete or unmount that folder.

Anyone knows how to get rid of that binding?..

UPDATE: one method I found is to start a container, export it, then import it back as a new image

Was it helpful?

Solution

This is not currently supported. I would do one of two things:

  • Ignore the directory. If there aren't any files in it then it shouldn't be making any difference.
  • Create the image again, using a Dockerfile - this is best practice.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top