Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Beginning DevOps with Docker

You're reading from   Beginning DevOps with Docker Automate the deployment of your environment with the power of the Docker toolchain

Arrow left icon
Product type Paperback
Published in May 2018
Publisher Packt
ISBN-13 9781789532401
Length 96 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Author (1):
Arrow left icon
Joseph Muli Joseph Muli
Author Profile Icon Joseph Muli
Joseph Muli
Arrow right icon
View More author details
Toc

Deploying a Docker Image to Docker Hub

Every time we run docker build, the image created is locally available. Normally, the Dockerfile is hosted together with the code base; therefore, on a new machine, one would need to use docker build to create the Docker image.

With Docker Hub, any developer has the opportunity to have a Docker image hosted to be pulled into any machine running Docker. This does two things:

  • Eliminates the repetitive task of running docker build
  • Adds an additional way of sharing your application which is simple to set up compared to sharing a link of your app's code base and README detailing the setup process

docker login is the command to run to connect to Docker Hub via the CLI. You need to have an account in hub.docker.com and enter the username and password through the terminal.

docker push <docker-hub-username/image-name[:tag]> is the command to send the image to the registry, Docker Hub:

Deploying a Docker Image to Docker Hub

A simple search of your image on hub.docker.com will give the output to your Docker image.

In a new machine, a simple docker pull <docker-hub-username/your-image-name> command will produce a copy of your image locally.

You have been reading a chapter from
Beginning DevOps with Docker
Published in: May 2018
Publisher: Packt
ISBN-13: 9781789532401
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime