Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker push image to Hub

I have modified, added some extra applications to a running container, now I would like to push it to Docker Hub. I have tagged my image like this: docker tag hellodocker:mytag <myuser>/hellodocker:mytag Pushing process was succesful, but after pull and run I see, that it contains only the base image, that I have used up, so intalled applications haven't "commited".

like image 354
plaidshirt Avatar asked Oct 01 '15 07:10

plaidshirt


2 Answers

1) First login by typing sudo docker login in the terminal. Enter username and password

2) Visit your docker account and create a new repository. In my case I created a repository zawad1879/dockerhub

3)Say you have a docker image with repository name:zawad/django and tag:latest.

In that case you will need to tag this image with a label of your wish. I decided to tag it with the label:myfirstimagepush. You tag the image by typing the command

sudo docker tag zawad/django:latest zawad1879/dockerhub:firstimagepush

4) Finally push the image to your repo using the command

sudo docker push zawad1879/dockerhub:firstimagepush

That's all there is to it.

like image 64
Crabigator360 Avatar answered Sep 29 '22 07:09

Crabigator360


It seems that you haven't done commit of your container. In order to do this - you have to execute the following command:

docker commit CONTAINER_ID CONTAINER_NAME

more on this: Docker commit

OR

You could simply execute docker command and see its output:

...
commit    Create a new image from a container's changes
...
like image 41
Yuri Avatar answered Sep 29 '22 08:09

Yuri