Publish a docker image
  • 15 Feb 2023
  • 1 Minute to read
  • Dark
    Light
  • PDF

Publish a docker image

  • Dark
    Light
  • PDF

Article summary

A docker image is published to a registry using 'docker push' command. 

A docker registry must be created before you can publish images. Data Explorer currently supports DockerHub, and AWS ECR hosted registries. Please refer to the corresponding registry provider documentation on the steps to create a docker registry. After creating a docker registry, the same must be registered under the Docker Repositories page on Data Explorer UI.

Typical commands to push the docker image to the registry are listed below. Please refer to your registry provider documentation for additional details.

DockerHub

  1. Set credentials using the docker login command.
    Shell
    docker login --username <username> --password <password>
  2. Push the docker image to the registry.
    Shell
    docker push repo/img:latest
  3. For the above example, the docker image is expected to have been tagged with repo/img:latest during the 'docker build' or later using the 'docker tag' command.

AWS ECR

  1. Set credentials using the docker login command. The 'aws' command line and necessary permissions to perform get-login-password must have been setup before executing this command.
    Shell
    aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin <account>.dkr.ecr.us-east-1.amazonaws.com
  2. Push the docker image to the registry.
    Shell
    docker push <account>.dkr.ecr.us-east-1.amazonaws.com/repo/img:latest
  3. For the above example, the docker image is expected to have been tagged with <account>.dkr.ecr.us-east-1.amazonaws.com/repo/img:latest during the 'docker build' or later using the 'docker tag' command.


Was this article helpful?