Preparing and pushing your images

Now that you are logged in to the DTR, you will be able to push your images once you have them properly named/tagged. Images are identified by the following naming properties:

  • The URL of the registry where they're stored
  • The username or namespace within the registry
  • The repository name
  • The image tag

Docker image naming format is as follows: Repo_URL / Namespace /Repo_name:Tag

  • Repo_URL: This is where your Docker DTR is located. The default value is docker.io (Docker Hub).
  • Namespace: This is the organization name or user name. The default value is empty (Docker official images).
  • Repo_name: This is the repository name. It's a required value with no default.
  • Tag: This is the repository tag name. The default value is latest.

Examples from Docker Hub (docker.io) include the following:

  • Repository for official CentOS image with latest tag: CentOS
  • Repository for official Ubuntu image with 16.04 tag: Ubuntu 16.04
  • Microsoft organization, .Net framework image with 3.5-sdk tagmicrosoft/dotnet-framework:3.5-sdk

Examples from my the app-dev organization in my private PoC DTR on AWS include the following:

  • My app image: ec2-xxx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/app-dev/app-image:v1 
  • My DB imageec2-xxx-xxx-xxx-xxx.us-west-2.compute.amazonaws.com/app-dev/db-image:v1 

As you can tell, my repository has an organization named app-dev and my user is part of that organization. Your Docker Enterprise administrator can set these up; then, you are ready to rename your images. In order to prepare your image, you will need to rename your images in the proper format for storing them in your PoC DTR. For this, we use the docker tag command:

$ docker image tag db-image:v1 {insert-your-DTR-URL-here}/{user-name or org-name}/db-image:v1
$ docker image push {insert-your-DTR-URL-here}/{user-name or org-name}/db-image:v1
$ docker image tag app-image:v1 {insert-your-DTR-URL-here}/{user-name or org-name}/app-image:v1
$ docker image push {insert-your-DTR-URL-here}/{user-name or org-name}/app-image:v1

After the image is pushed, enter you DTR URL into the browser and don't forget the https:// prefix. Then, look at the repositories. You should see something like the screen shown in Figure 16:

Figure 16: PoC Images in the Docker Trusted Registry

Next, we will look at deploying our PoC application to the Docker Enterprise cluster.