Pushing an Image to Docker Hub Repository

greenteabiscuit

Reishi Mitani

Posted on September 19, 2020

Pushing an Image to Docker Hub Repository

Login first.

$ docker login
Enter fullscreen mode Exit fullscreen mode

Check the container id for uploading.

$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                               NAMES
9dd3857e08fb        up_django           "python manage.py ru…"   36 hours ago        Up 2 minutes        80/tcp, 0.0.0.0:8000->8000/tcp      up_django_1
Enter fullscreen mode Exit fullscreen mode

We will push up_django.

$ docker commit 9dd3857e08fb up-django-container:ver-1
Enter fullscreen mode Exit fullscreen mode

We will attach a tag and remote repository name to the local repository image.

$ docker tag up-django-container:ver-1 USERNAME/up-django-container:ver-1
Enter fullscreen mode Exit fullscreen mode

Finally push the image.

$ docker push USERNAME/up-django-container:ver-1
Enter fullscreen mode Exit fullscreen mode

We will see the repository uploaded to on the online docker hub website.

💖 💪 🙅 🚩
greenteabiscuit
Reishi Mitani

Posted on September 19, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related