Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in DevOps and Agile by (29.3k points)

If I want to push the docker container to the docker hub repository should I have to convert that container into the image and push it or can I directly push the container without converting it into image?

Please clarify my doubt.

1 Answer

0 votes
by (50.2k points)

Run an Ubuntu container, you're basically pulling the ubuntu container from online and say you make a change to it (like installing software into it). Now, just like in GitHub, before you push your changes, you've to 'commit' them.
 

Just committing the changes you've made to the container shall make a container that is ready to be pushed. And, no additional building is required.
 

To commit, use: 

sudo docker commit <container-id> username/container-name-that-you-want

To push, use:

sudo docker push username/same-container-name-that-you've-specified-above.

For more information, check out this Docker Tutorial.

Related questions

0 votes
1 answer
asked Mar 20, 2020 in DevOps and Agile by chandra (29.3k points)
+1 vote
3 answers
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...