-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Conversation
If bind-volumes are submitted to docker >= 1.4.0 with the volumes set in addition to the binds, docker will create a regular volume and not bind-mount the specified path.
I tried out this patch locally since I needed the functionality, and I hit a case where this fix didn't work. If the image specifies a volume directory, and you try to bind a local directory to the volume directory, Docker won't bind the container directory to the host directory. For example, the Dockerfile of the official nginx image contains:
If you try to bind this directory to a local directory using the docker module, Docker still won't do the bind correctly:
I worked around it by passing the bind info in the
This seems to be discussed in docker/docker-py#419 as bug in docker-py. |
…ker-py docs. Do not add host-binds to volumes list.
I've updated my PR with additional changes. Things I've tested successfully with the official nginx image running the image without additional binds
running the image and overriding the VOLUME from the Dockerfile
This looks like correct behavior to me. @lorin |
@steveej Just tested it out, this commit resolves the issue. 👍 |
This would be really nice to see fixed,makes it difficult to use ansible to orchestrate containers |
Have the same problem. Please accept this PR. +1 |
same issue here. |
+1 |
Lots of love for this PR, including a +1 from @lorin -- promoting to P1_reviewed. |
Fix bind-volumes on docker >= 1.4.0
If bind-volumes are submitted to docker >= 1.4.0 with the volumes set in addition to the binds, docker will create a regular volume and not bind-mount the specified path.