Use Docker Hub

Create a repository on Docker Hub

  1. Go to Docker Hub, which has been prepared, and create a repository there.
  2. Scroll down and click Create repository

8.2.1.png

  • Choose the Namespace as your account.
  • Enter the repository name: fcajresbar-fe
  • Enter the description: Frontend Image of FCAJ Resbar
  • Select Visibility: Public
  • Review and select Create

8.2.2.png

  • Successfully created a repository on Docker Hub.

8.2/3.png

  1. Similarly, create a repository for the backend image.
  • Choose the Namespace as your account.
  • Enter the repository name: fcajresbar-be.
  • Enter the description: Backend Image of FCAJ Resbar.
  • Select public.
  • Review and select Create.

8.2/4.png

  1. Successfully created a repository on Docker Hub.

8.2.5.png

Push frontend and backend image to Docker Hub

  1. Run the docker login command to authenticate. If you are already logged in with a different account, log out first, then log in using the credentials associated with your repositories 8.2.6.png

  2. List all available Docker images on your local machine

docker image ls

8.2.6.png

  1. Tag the Frontend Image and Backend Image
docker tag aws-fcaj-container-app-frontend <username>/fcajresbar-fe
docker tag aws-fcaj-container-app-backend <username>/fcajresbar-be

8.2.6.png

  1. Push the images to Docker Hub
docker push <username>/fcajresbar-fe
docker push <username>/fcajresbar-be

8.2.6.png

If we don’t specify a tag in the docker tag command, it will automatically add the latest tag to the image.

Results

After pushing, we can see that the images have been pushed to their respective repositories.

8.2.10.png

8.2.11.png