Member-only story

Pushing Images to Docker Hub — Learning Docker

Izzat Arramsyah
2 min readJul 29, 2023

--

INTRODUCTION

After successfully creating images from our application, the next step is usually to deploy these images. However, before deploying images, we often need to push the images first so that the server can later pull the images and deploy them.

For the sample Node.js project, you can clone it here.

PUSH IMAGES TO REPOSTIROY

Here, we will use Docker Hub as our image repository. Please register here if you haven’t. After that, create a repository for your images.

Once you’ve successfully created the repository, log in using the terminal with the following command:

docker login -u username

Now, let’s build the Docker images:

docker build -t docker-rest-api:latest .

Next, we will tag the Docker images to be used for pushing to Docker Hub:

docker tag docker-images-name:tag username/docker-images-name:tag

After successfully tagging, we will push the Docker images:

docker push username/docker-images-name:tag

--

--

No responses yet