In docker v0.8, you can run a new command in a running container so that you can do what you want.
In the meantime, one solution would be to use volumes.
Option 1: Managed Volume Dockers
FROM ubuntu ... VOLUME [ "/var/www/app/public" ] ADD host/src/path/var/www/app/public CMD >
Run and run your container, then when you need git pull, you can simply:
$docker ps # - > $ docker run -volumes-from < container id > < git > sh -c 'cd/var/www/app/public && & & git pull -u ' >
This will cause your first running container to update sources.
Option 2: Host Volumes
You can start your container with
$docker run -v `pwd`/srcs:/var/www/app/public <yourimage> >
and then just git pull in the source directory of your host, it will update the container sources.
creack Sep 17 '13 at 21:33 2013-09-17 21:33
source share