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?

  • docker mysql-server not starting on ubuntu [closed]
  • Docker container data goes blank when mapped with host data directory
  • Install vim in node Docker image
  • Docker mount socket volume
  • Docker log file not created
  • docker postgres pgadmin local connection
  • Error when building a Docker container
  • Docker+Rails+Postgres: app can't access database container
  • Docker base image running slowly Mac OS X
  • “” working on Mac, but not on Linux
  • fail to access mysql via docker link
  • HTTP response 403 when trying to push to registry
  • 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.