Docker Community Forums

Share and learn in the Docker community.

Dockerfile and Git

Hi all,

Sorry if this is a newbie question, but I can’t really figure out how to solve my problem.
Currently I have a Dockerfile that clones from a private Git repository on our internal network and the image is stored on our local registry.

Now I need to upload the image to Docker hub meaning that I can’t have the Git clone part in the file since it will be a public repository.
Does anyone have a solution on how I can pull from the Git repo after the image has started without doing it manually? Or is there a better solution for this problem?

you don’t need to upload the image to the public docker hub.

but if you want so, you just could do by

docker tag your_private_repo:5000/foo/bar your_docker_hub_account/bar
docker push your_docker_hub_account/bar

But you cannot have an automated build, cause your repo is on an internal network.
So better establish a CI job which keeps the docker-hub image up to date.