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?

  • Undefined http response from requests between containers with docker compose
  • Is Memory consumption is also Dynamic just like CPU for Docker Containers
  • Fail pod on container failure
  • How do I deal with security updates in Docker images?
  • installing docker cloud cli on windows
  • symfony classes.map failed to open stream: No such file or directory
  • Docker engine api ContainerTop ps_args not having any effect
  • How to restart a single container with docker-compose
  • Accessing CoreClr web api hosted in Docker
  • How to mount volume from container to host in Docker?
  • Kubernetes master is OK yet minions not working
  • Use apt-get fails on docker python:2.7.12-wheezy image
  • 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 (bootstrap.sh), 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.