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

https://stackoverflow.com/questions/29956500/docker-public-registry-push-fails-repository-does-not-exist/37036348

https://stackoverflow.com/questions/41984399/denied-requested-access-to-the-resource-is-denied-docker

https://www.techrepublic.com/article/how-to-create-a-docker-image-and-push-it-to-docker-hub/

https://ropenscilabs.github.io/r-docker-tutorial/04-Dockerhub.html

 

Leave a Reply

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