docker-alpine icon indicating copy to clipboard operation
docker-alpine copied to clipboard

Do not use VOLUME

Open Vanuan opened this issue 8 years ago • 2 comments

If you specify a volume in Dockerfile, it would be impossible to remove/override it using command line options. Moreover, it would leave dangling volumes for inexperienced users and users of docker-compose. In docker-compose, you wouldn't be able to specify mounted volume. Please let the user specify the volume location.

Vanuan avatar Jun 30 '16 22:06 Vanuan

If you use your own volume attribute during run or similar, it will use that and not the one in the Dockerfile. At least the one in the Dockerfile keeps it out of the container if someone doesn't specify a volume. I agree that it could/will lead to orphaned volumes but that seems like general issue not specific to this.

lgelfan avatar Jul 19 '16 18:07 lgelfan

If you use your own volume attribute during run or similar, it will use that and not the one in the Dockerfile.

If it should, then it is a bug in docker-compose, because for me it doesn't work. There are dangling volumes all over the place.

Vanuan avatar Jul 19 '16 23:07 Vanuan