Reputation: 5510
I have a bash script recipe that creates large assets. I'd like to create them once and use them in different docker containers. I'm assuming the best way to handle this is to create a docker volume containing these assets but how do I do that? I prefer not copy files into the volume directly from the host as that's not really version controlled. Can this be achieved using dockerfiles?
Upvotes: 0
Views: 91
Reputation: 5510
I think this answers my question. In summary:
Dockerfile
that's along these lines:FROM ubuntu RUN mkdir /dataset RUN ***populate /dataset*** VOLUME /dataset
/dataset
in any container you need using --volumes-from
optionUpvotes: 0
Reputation: 578
You can use docker-compose.yml to set up a volume sharing between containers. And you can declare mount points in respective Dockerfiles using VOLUME
instruction. More in detail explanation is in Volumes Documentation
Upvotes: 1