Docker Documentation References:
The purpose of this kata is to familiarize yourself with the process of pushing a Docker Image to a shared repository (Docker HUB).
In this exercise, we will login, tag, push an image to the Docker Hub repository, and then list out images.
Please note that the image you push here cannot be deleted via the CLI from the remote repository, you will need to use the tools provided by the repository to remove the image. Also note, Azure's Container Registry does not support delete, so if you push an image there you are stuck with it.
Command
docker login --username rdammkoehler --password *******************
Note: By default the login command logs you into
https://index.docker.io/v1/
however you can specify an alternate server in this location. The configuration of available servers (servers you have used before) is stored at$HOME/.docker/config.json
Output
thought:DockerKata rich$ docker login --username rdammkoehler --password *******************
Login Succeeded
Command
docker tag nginx:alpine rdammkoehler/nginx:docker_kata
Note: the use of mine as a tag is a totally arbitrary value for demonstration purposes
Output
thought:DockerKata rich$ docker tag nginx:alpine rdammkoehler/nginx:docker_kata
Command
docker push rdammkoehler/nginx:docker_kata
Output
thought:DockerKata rich$ docker push rdammkoehler/nginx:docker_kata
The push refers to a repository [docker.io/rdammkoehler/nginx]
c179fee9afab: Mounted from library/nginx
5b9c3a4ab3e9: Mounted from library/nginx
b7959b8fc470: Mounted from library/nginx
e154057080f4: Mounted from library/nginx
docker_kata: digest: sha256:33eb1ed1e802d4f71e52421f56af028cdf12bb3bfff5affeaf5bf0e328ffa1bc size: 1153
Command
docker images
Output
thought:DockerKata rich$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx alpine f00ab1b3ac6d 2 weeks ago 15.5 MB
rdammkoehler/nginx docker_kata f00ab1b3ac6d 2 weeks ago 15.5 MB
Note: There is no CLI for deleting an image from a remote repository at this time. So using
docker rmi
will remove the image from your local repository and /or untag the remote image but it does not actually remove the image from the remote repository. In order to do that you need to visit the repository and determine how it works for that specific repo.