I am trying to create a docker container that has an external volume that should contain several folders, so my simplified version of the Dockerfile looks like this:
FROM ubuntu:12.04
When I start the container with
sudo docker run -i -t -v /uploads:/uploads [IMAGE ID] /bin/bash
The / uploads folder does not contain folder1 or folder2. However, if I replace the line VOLUME uploads with RUN mkdir /uploads , it works with this command
sudo docker run -i -t [IMAGE ID] /bin/bash
but not with this command (folders are missing again):
sudo docker run -i -t -v /uploads:/uploads [IMAGE ID] /bin/bash
How to configure a docker file so that files / folders are automatically added to the directory with the host installed when the container starts?
docker volume
Programster
source share