# Dockerfile and Git

**URL:** <https://forums.docker.com/t/dockerfile-and-git/27995>\
**Category:** General\
**Created:** [February 3, 2017, 8:37am UTC](https://forums.docker.com/t/dockerfile-and-git/27995 "2017-02-03T08:37:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgutehall](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/mgutehall/32/15052_2.png) [@mgutehall](https://forums.docker.com/u/mgutehall)\
**Post date:** [February 3, 2017, 8:37am UTC](https://forums.docker.com/t/dockerfile-and-git/27995/1 "2017-02-03T08:37:18Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![think](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/think/32/14641_2.png) [@think](https://forums.docker.com/u/think)\
**Post date:** [February 5, 2017, 8:20pm UTC](https://forums.docker.com/t/dockerfile-and-git/27995/2 "2017-02-05T20:20:13Z")

</div>

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.
