An alpine-based docker container that pulls a git repo every given amount of time (default 60s)
524
Stripped and extended desription from the original git repo
An alpine-based docker container that pulls a git repo (updates it) every given amount of time (default 60s) with a shell script. The resulting image is approx. 20MB at size.
There are many scenarios where such a container could help. For example (as I use it), this image could be used to pull a hugo built website (living in a public git repo) to a local folder, so that another docker container can serve the most recent files.
Please be aware of the fact that this image currently does no merging if some local file changed (maybe up to the future).
See the docker-compose example for a quick overview how this works.
Essentially, this image can be configured over environment variables.
PULL_LOCATION: used to set the container-internal folder which is getting pulled frequently (you should mount one into this direction) - defaults to /to-pullPULL_INTERVAL: the interval between pulls in seconds (minimum is 5, default is 60)PULLER_UID: the uid of the user that executes the git pull command (defaults to 1000)GIT_OUTPUT: if set to 0, the git pull stdout will be hidden from docker logs (redirected to /dev/null ;) (if not set, everything is visible in the docker logs)services:
git-puller:
image: bluefox42/git-puller
volumes:
- ./to-pull:/to-pull
environment:
PULL_LOCATION: "/to-pull" # the folder with the git repo to pull
PULL_INTERVAL: 10 # time in seconds between pulls (minimum is 5)
PULLER_UID: "1000" # the uid of the user that executes the 'git pull' command in the container (if set to 0, root will do it!)
GIT_OUTPUT: "0" # if this is 0, the git command's stdout will not be shown in 'docker logs'
Content type
Image
Digest
sha256:492153016…
Size
9.3 MB
Last updated
almost 2 years ago
docker pull bluefox42/git-puller