Clones a git repository over ssh, checks out a branch and then periodically pulls updates.
466
A docker container that clones a git repository over ssh, checks out a branch and then periodically pulls updates.
There is an automated build based on master available on dockerhub in nerdalize/gitpuller.
To build the container locally do:
docker build -t gitpuller .
The simplest way is to specify a github repository. This requires setting up a Deploy Key on github. Mount the private ssh deploy key in /root/.ssh/id_rsa when starting the container. The container will add github.com to known hosts, allowing non-interactive access to github over ssh. It will then clone the repository into /repo inside the container and checkout the master branch. Mount a volume to /repo to enable sharing the repository with other containers. Then every minute it will issue a git pull on the repo.
docker run \
-e [email protected]:USERNAME/REPO.git \
-v /home/someone/keys_with_pull_access/id_rsa:/root/.ssh/id_rsa \
nerdalize/gitpuller:latest
Several parameters can be configured at container start-time:
docker run \
-e [email protected]:USERNAME/REPO.git \
-e REPO_DIR_PATH=/repository \
-e REPO_DOMAIN=github.com \
-e REPO_BRANCH_NAME=version1 \
-e WAIT_SECONDS=120 \
-v /home/someone/keys_with_pull_access/id_rsa:/root/.ssh/id_rsa
nerdalize/gitpuller:latest
Content type
Image
Digest
Size
13.7 MB
Last updated
over 9 years ago
docker pull nerdalize/gitpuller