This container is specifically to clone and update a git repo. It is based on the minimalist Alpine Linux, and installs:
The intention is to be able to use this to create a data container, and other
containers can subsequently mount /app via --volumes-from.
docker run --name=app stevepacker/git clone [email protected]:you/it.git
will clone the repo into /appdocker run --volumes-from=app stevepacker/git pull
will change into /app and pull the latest code for whatever branch is
currently checked outdocker run --volumes-from=app stevepacker/git checkout 1.1.0
will change into /app, fetch the latest from origin, checkout tag 1.1.0,
and pull the latest codedocker run --rm -it stevepacker/git -- sh
getting access to the shelldocker run --rm -it stevepacker/git -- whoami
run any arbitrary linux commandThis repo clones the files under a non-privileged user "app" with UID=1000
/app is where the repo is cloned to./home/app/.ssh/ may be an interesting directory for you if you'd like to inject
an OpenSSH private key to help you clone a private repo over SSH.GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
is pre-configured to allow a clone over SSH to succeed without host key checking./home/app/.ssh/known_hostsGIT_BRANCH="master" is pre-configured. If you'd rather checkout a different tag
or branch, change this accordingly.Content type
Image
Digest
Size
12.4 MB
Last updated
about 10 years ago
docker pull stevepacker/git