How to setup git and git-sync in a docker container?

I want to setup up git and git-sync in my new docker container but I am not sure how to do that or if that is the right way to do it? If there is a easier way to do it for example I also use kubernetes and I am trying to see what kubernetes can do as far as git-sync is concerned. Any ideas?

  • How to put fluentd containers behind a load balancer in ECS?
  • Docker run command with environment variables
  • New device node created on host does not get reflected in Docker container when using --device flag
  • git push not working from jenkins docker
  • Dockerfile won't run script as user with sudo rights
  • Dockerized Elasticsearch - Scripting not working
  • Setting TLS opptions for Docker as Environment Variables
  • Docker caching for travis builds
  • nginx as load balancer: upstream with path
  • ElasticSearch on Elastic Beanstalk
  • Docker: Push data container onto Docker Hub
  • How can I know which docker will restart after docker daemon restarts
  • 2 Solutions collect form web for “How to setup git and git-sync in a docker container?”

    Don’t treat Docker container as a VM. Usually you shouldn’t go to the container to run commands or to set up settings. Use docker build to build all what do you need (jar file, JVM server, ….) from Dockerfile and use environment variable to handle any settings (or volume with setting file). Your container image entrypoint (cmd) can be some your script (, which can handle also some start activities. Generally: your container should be stateless. For versioning use tags. Take your time and read some doc and some real Docker app examples. You will see there what is the best practice.

    Is this what you’re looking for: kubernetes/contrib/git-sync/

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.