Getting started with Amazon ECR Public - Amazon ECR Public
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Getting started with Amazon ECR Public

Get started with Amazon ECR public repositories by creating your first public repository and setting your public registry settings in the Amazon ECR console. The Amazon ECR console guides you through the process to get started.

Prerequisites

Before you begin, be sure that you've completed the steps in Setting up with Amazon ECR.

To build, tag, and push container images to your Amazon ECR public repositories you must have the Amazon CLI and a CLI client, for example the Docker CLI, to do this. Docker is a common tool for building container images. Docker is available on many different operating systems, including most modern Linux distributions, like Ubuntu, and even Mac OSX and Windows. You don't need a local development system to use Docker. If you are using Amazon EC2 already, you can launch an Amazon EC2 instance and install Docker to get started. For more information about how to install Docker on your particular operating system, go to the Docker installation guide.

To use the Amazon CLI with Amazon ECR Public, install the latest Amazon CLI version. For information about installing the Amazon CLI or upgrading to the latest version, see Installing the Amazon CLI version 2 in the Amazon Command Line Interface User Guide.

Create a public repository

To create a public image repository (Amazon Web Services Management Console)

A repository is where you store your Docker or Open Container Initiative (OCI) images in Amazon ECR that you want to make publicly available for others to pull.

  1. Open the Amazon ECR console at https://console.amazonaws.cn/ecr/get-started.

  2. Choose Get Started.

  3. For Visibility settings, choose Public.

  4. For Repository name, enter a unique name for your public repository.

  5. (Optional) For Repository logo, choose Upload file and select a local image file to use as the repository logo.

    Note

    The repository logo is only publicly visible in the Amazon ECR Public Gallery for verified accounts. A verified account is an account that is Amazon Web Services Marketplace certified.

  6. For Short description enter a description of the repository. The description field is displayed on the Amazon ECR Public Gallery in the search results and on the repository detail page.

  7. For Content types select the operating system and system architecture tags to associate with the repository. These tags are publicly displayed in the Amazon ECR Public Gallery as badges on the repository and are used as search filters.

  8. For About, enter a detailed description for the repository. This text should be in Github Flavored Markdown format. For format examples, see Repository catalog data. This field is publicly visible on the Amazon ECR Public Gallery on the repository detail page.

  9. For Usage, enter details about how to use the images in the repository. This text should be in Github Flavored Markdown format. For format examples, see Repository catalog data. This field is publicly visible on the Amazon ECR Public Gallery on the repository detail page.

  10. Choose Create repository.

Push a Docker image

Build, tag, and push a Docker image

You can build, tag, and push a container image using the Docker CLI. You can use a container image that you have built from a Dockerfile or one that you pulled from another registry, such as a private Amazon ECR repository or Docker Hub and then push the tagged image to your public repository. For more detailed steps on using the Docker CLI, see .

  1. Select the public repository you created and choose View push commands to view the steps to push an image to your new repository.

  2. Run the login command that authenticates your Docker client to your registry by pasting the command from the console into a terminal window. This command provides an authorization token that is valid for 12 hours.

  3. (Optional) If you have a Dockerfile for the image to push, build the image and tag it for your new repository. Pasting the docker build command from the console into a terminal window. Make sure that you are in the same directory as your Dockerfile.

  4. Tag the image with the URI of your public registry and your new repository by pasting the docker tag command from the console into a terminal window. The console command assumes that your image was built from a Dockerfile in the previous step. If you did not build your image from a Dockerfile, replace the first instance of repository:latest with the image ID or image name of your local image to push.

  5. Push the newly tagged image to your repository by pasting the docker push command into a terminal window.

  6. Choose Close.

Edit the registry settings

(Optional) To edit your public registry settings

Each Amazon account is provided with a default public Amazon ECR registry. The public registry is assigned a default alias after you have created your first public repository or requested a custom alias. Once Amazon ECR approves your custom alias request, it will appear when describing your registry as well as on your public repositories on the Amazon ECR Public Gallery.

The registry alias is part of the repository URI that is used to pull the images in the public repository. The following steps walk you through requesting a custom alias and setting a display name for your registry.

  1. Open the Amazon ECR console at https://console.amazonaws.cn/ecr/.

  2. From the navigation bar, choose the Region to edit your public registry settings in.

  3. In the navigation pane, choose Registries.

  4. On the Registries page, select your Public registry and then choose Edit.

  5. For Custom alias, enter a custom alias to request.

  6. For Display name, enter a display name for your registry.

  7. Choose Save changes.