The problem was that I wanted to add files to the /webapp directory, but once the Dockerfile defines it as volume you can't modify it as part of the container definition, you can only mount to it from outside.
My general approach is to have two images, one without the volumes, for use in defining derived containers, and a working image that defines the volumes so they are ready for mounting from other containers or from the host.
I suppose another way to handle it is to not define the volumes at all and then do it in Docker-compose scripts (I'm using docker-compose to manage all my related containers and provide a convenient way to manage everything through one command).
Cheers,
E. ---- Eliot Kimber, Owner Contrext, LLC http://contrext.com
On 2/19/16, 4:27 PM, "Jens Erat" jens.erat@uni-konstanz.de wrote:
Hi Eliot,
Looks like this version addresses the issue I had (creating volumes in the base container made it impossible to add repos or webapps in using Dockerfiles).
that's also one of the issues the earlier Dockerfile of Dirk and Michael had -- and I also had issues with that when I started with Docker. It's somewhat counter-intuitive that you have to `EXPOSE` ports to publish them, but not define `VOLUME`s to bind them.
Defining a volume in a Dockerfile results in a bind-mount of a new, empty folder (if not defined otherwise through `--volume[-from]`) during container instanciation. So you can very well add files into the image -- but they're hidden by that bind mount in the running container.
Regards, Jens
-- Jens Erat
OpenPGP: 0D69 E11F 12BD BA07 7B37 26AB 4E1F 799A A4FF 2279