Push an image to Docker Hub

Here’s a minimal example:

1. docker login -u <username> -p <password>

2. docker tag <image id> <username>/<name_of_repo>:<tag>

3. docker push <username>/<name_of_repo>:<tag>


and a full blown example:

  1. pull image

docker pull ubuntu

2. create container

docker run –name test-lamp-server -it ubuntu:latest bash

3. inside container, update:

apt-get update

4. install LAMP

apt-get install lamp-server^

5. commit the changes to an image

docker commit -m “Added LAMP Server” -a “NAME” test-lamp-server USER/test-lamp-server:latest

NAME: full name

USER: your Docker hub username

6. tag

docker tag <image> USER/test-lamp-server

7. Login to Docker hub

docker login

8. Push image to Docker Hub

docker push USER/test-lamp-server


More info






Leave a Reply

Your email address will not be published. Required fields are marked *