Docker Community Forums

Share and learn in the Docker community.

Best practices for getting code into a container (git clone vs. copy vs. data container)

docker

(Nirandaperera) #21

Hi @dineshbhat
the entrypoint method seems to be a very simple approach. May I know if you were able to get it working?
According to this [1], it should be possible

[1] https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact
Best


(1133685) #22

Hi

I need basic thing how can i clone public git repo into docker container, but still not found any helpful information. Seriously very poor documentation from docker.


(Killstreet) #23

This is not remotely what docker themselves should handle, non the less, install git and do git clone either inside the container, or, as more prefered you run git clone outside the container, and use the copy method provided with docker to copy the project inside the container.


(Markris5) #25

Creates a new subdirectory named .git that contains all of your necessary repository files — a Git repository skeleton. Nothing in your project is tracked yet. (See Git Internals) for more information about exactly what files are contained in the .git directory you just created.)

If you want to start version-controlling existing files (as opposed to an empty directory), you should probably begin tracking those files and do an initial commit.

Cloning an Existing Repository

Clone a repository with git clone <url> . Example, if you want to clone the Git linkable library called libgit2 , Hope it helps. Go2top FIFA 18.