Is it possible to provide a file to a docker container during the run operation to be used during startup of the container?
Essentially I want to provide a txt file similar to plugins.txt in jenkins docker to a tomcat server. That file should contain names and versions (name:version) of .war and .jar files to be downloaded during startup of the container. I expect of this setup to be more flexible to provide customized containers for customers rather than having customer specific images. But the big questions for me are:
You can mount individual files into a container as a volume:
docker run -v `pwd`/conf.txt:/app/conf.txt my_app
That needs to be run on the docker host itself, or under a User directory on Windows/MacOS. You can also create a named volume in docker where you can store these files and update via temporary containers.
With those volume mounts, you do need to be careful with permissions, uid's inside the container may not match your uid on the host. You also have the ability to mount the files read only with a simple :ro appended to the volume mount.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With