• HOME
  • TECH BLOG
  • MIGRATING TO AMAZON WEB SERVICES
  • IT PROJECT MANAGEMENT BLOG
  • Q&A
  • INTERACTIVE LEARNING

STEP 1: GO TO THE DOCKER HUB WEBSITE



Go to docker Hub and create an account.
https://hub.docker.com



STEP 2: CREATE A DOCKER HUB ACCOUNT



Choose a Docker ID and password as well as providing your email address.
Agree to the terms of service and the privacy policy.



STEP 3: CONFIRM YOUR EMAIL ADDRESS



You will be sent a confirmation email in order to verify your account.



STEP 4: CREATE A REPOSITORY



CLICK ON CREATE A REPOSITORY



Underneath "Download and Take a Tutorial" Click on Create a Repository. This will create a repository through Docker Hub via the web browser.



STEP 5: GIVE YOUR REPOSITORY A NAME



Give your repository a name and description.



Give your repository a name and description. Underneath visibility you can choose your repository to be either Public or Private.



STEP 6: YOUR REPOSITORY HAS BEEN CREATED



Your repository has been created.



Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada faucibus ex nec ultricies. Donec mattis egestas nisi non pretium. Suspendisse nec eros ut erat facilisis maximus. In congue et leo in varius. Vestibulum sit amet felis ornare, commodo orci ut, feugiat lorem.


STEP 7: CREATE A REPOSITORY FROM THE CLI



Use the command: docker login

Enter your Docker Hub login and then your password.



Previously we created a repository by going to the Docker Hub website and creating a repository. Now we will see how to create a repository from the command line.



STEP 8: DOCKER IMAGES



Type in the command docker images to display the available images.



Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed malesuada faucibus ex nec ultricies. Donec mattis egestas nisi non pretium. Suspendisse nec eros ut erat facilisis maximus. In congue et leo in varius. Vestibulum sit amet felis ornare, commodo orci ut, feugiat lorem.


STEP 9: TAG YOUR IMAGE ID



Tag your existing image id.



Take the existing image id <1cc5fb94e64b> and tag i


docker tag <IMAGE ID> <Hub User Name>/<IMAGE NAME>:TAG


docker tag 1cc5fb94e64b certifiedcloudexpert/new:ver1

where:

<1cc5fb94e64b> will be the IMAGE ID

<certifiedcloudexpert> will be the Hub User Name

<new> will be the IMAGE NAME (The IMAGE NAME you created)

<ver1> will be the TAG (The TAG you created)


PS:

It's best common practice to tag your HUB USERNAME followed

by your IMAGE NAME otherwise when you push your image to

Docker Hub you may get a permission denied error message.






STEP 10: DOCKER IMAGES



Run the command docker images once again.



As you can see at the very top under REPOSiTORY

<certifiedcloudexpert/new> has been created with the TAG ver1.





STEP 11: DOCKER PUSH



Run the command docker push to upload the image to Docker Hub.



docker push< your hub username>/<your IMAGE NAME>

docker push certifiedcloudexpert/new





STEP 11: VIEW YOUR NEW REPO ON DOCKER HUB



Go to Docker Hub to view the newly created repo.



Go to Docker Hub and notice how the repo that was just pushed called new is now showing.



CERTIFIED CLOUD EXPERTS | AWS PARTNER NETWORK
CLOUD CONSULTING FIRM | (516) 387-2085 | CONTACT US