The goal is to add data to my database server containers of a multi-container web app from a download using curl once the database containers are running. I can do this from docker-compose.yml or from docker run independent of the web app, as long as I use host volumes.
How do I do it without using host volumes or web app specific Dockerfiles?
Docker Compose example with host volumes:
dbinit: build: ./webtools_config/initdb command: bash -c "/tmp/webtools_config/dbinit.sh" volumes: - ./webtools_config:/tmp/webtools_config links: - db1 - db2
Example of a docker run, that I would like to pass a script file local to the docker client such as ./dbinit.sh:
docker run -a stdin -a stdout -i -t \ --link dir_db1_1:db1 \ --link dir_db2_1:db2 \ initdb /bin/sh -c "./dbinit.sh"