I actually trying to achieve something with Docker but I'm stuck, there is my problem.
I have my container hosted on EC2 with my web app inside it. My webapp use as database a JCR repository which is basically a file stored where you want. So each time my web app start, if the repository doesn't exist, it create it otherwise it use the existing.
My current docker file look like this https://gist.github.com/agonist/7cab7358379e9dd6e812 ./chameleon.sh start just start my webapp. In this app, I configured where the repository file is located.
Now I creted a EBS volume attached and mounted in my EC2 instance. This volume will be dedicated to store the repository. So basicaly in my app I configure my repository path to /mnt/repository/
where repository is the directory which will contain my repository file created by my web app.
But I don't know how I can mount this volume to my container before the ./chameleon.sh start
in the Dockefile. As I see during my research
docker run -v /mnt/repository:/mnt/repository aws_beanstalk/current-app
is not executable from the Dockefile.
I also found stuff about data only container which share a volume with another container, but still the same probleme if I have to run
sudo docker run -d --volumes-from dbdata
after my container started