Skip to content

Commit

Permalink
Created HowToPushImageToECR Markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
hadiparsianNIH authored Jan 27, 2025
1 parent 849540b commit b0ec1e2
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/HowToPushImageToECR.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Pushing Public Docker Images to Private ECR

We will go through how to push a public docker image to a private repository in Elastic Container Registry.

## Part 1: Pull a Docker image

* In AWS console, In a notebook instance, Open JupyterLab:

![](../images/ECR/5.PNG)

* Open Terminal:

![](../images/ECR/6.PNG)

* Pull a Docker iamge: `docker pull public.ecr.aws/v8e3m3v4/sagemaker-studio/r:latest`

![](../images/ECR/7.PNG)

## Part 2: Create a repository in ECR

* In AWS console, type *ECR* in search bar and then click **Elastic Container Registry**:

![](../images/ECR/1.PNG)

* Click **Create repository**:

![](../images/ECR/2.PNG)

* Give a name and then create the repository:

![](../images/ECR/3.PNG)

* Copy URI of your repository for the next part:

![](../images/ECR/4.PNG)

## Part 3: Push Docker image to ECR

* Retrieve an authentication token and authenticate your Docker client to your registry:

`aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 664418964547.dkr.ecr.us-east-1.amazonaws.com/sagemaker/r-kernel`

![](../images/ECR/8.PNG)

* Tag your image so you can push the image to this repository:

`docker tag public.ecr.aws/v8e3m3v4/sagemaker-studio/r:latest 664418964547.dkr.ecr.us-east-1.amazonaws.com/sagemaker/r-kernel:latest`

![](../images/ECR/9.PNG)

* Run the following command to push this image to your newly created AWS repository:

`docker push 664418964547.dkr.ecr.us-east-1.amazonaws.com/sagemaker/r-kernel:latest`

![](../images/ECR/10.PNG)
Binary file added images/ECR/1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/10.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/4.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/5.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/6.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/7.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/8.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ECR/9.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b0ec1e2

Please sign in to comment.