Skip to content

Commit 27d8739

Browse files
Merge pull request #55 from NIGMS/hadi
Created HowToPushImageToECR Markdown
2 parents 849540b + b0ec1e2 commit 27d8739

File tree

11 files changed

+55
-0
lines changed

11 files changed

+55
-0
lines changed

Diff for: docs/HowToPushImageToECR.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Pushing Public Docker Images to Private ECR
2+
3+
We will go through how to push a public docker image to a private repository in Elastic Container Registry.
4+
5+
## Part 1: Pull a Docker image
6+
7+
* In AWS console, In a notebook instance, Open JupyterLab:
8+
9+
![](../images/ECR/5.PNG)
10+
11+
* Open Terminal:
12+
13+
![](../images/ECR/6.PNG)
14+
15+
* Pull a Docker iamge: `docker pull public.ecr.aws/v8e3m3v4/sagemaker-studio/r:latest`
16+
17+
![](../images/ECR/7.PNG)
18+
19+
## Part 2: Create a repository in ECR
20+
21+
* In AWS console, type *ECR* in search bar and then click **Elastic Container Registry**:
22+
23+
![](../images/ECR/1.PNG)
24+
25+
* Click **Create repository**:
26+
27+
![](../images/ECR/2.PNG)
28+
29+
* Give a name and then create the repository:
30+
31+
![](../images/ECR/3.PNG)
32+
33+
* Copy URI of your repository for the next part:
34+
35+
![](../images/ECR/4.PNG)
36+
37+
## Part 3: Push Docker image to ECR
38+
39+
* Retrieve an authentication token and authenticate your Docker client to your registry:
40+
41+
`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`
42+
43+
![](../images/ECR/8.PNG)
44+
45+
* Tag your image so you can push the image to this repository:
46+
47+
`docker tag public.ecr.aws/v8e3m3v4/sagemaker-studio/r:latest 664418964547.dkr.ecr.us-east-1.amazonaws.com/sagemaker/r-kernel:latest`
48+
49+
![](../images/ECR/9.PNG)
50+
51+
* Run the following command to push this image to your newly created AWS repository:
52+
53+
`docker push 664418964547.dkr.ecr.us-east-1.amazonaws.com/sagemaker/r-kernel:latest`
54+
55+
![](../images/ECR/10.PNG)

Diff for: images/ECR/1.PNG

75.9 KB
Loading

Diff for: images/ECR/10.PNG

17 KB
Loading

Diff for: images/ECR/2.PNG

26.3 KB
Loading

Diff for: images/ECR/3.PNG

102 KB
Loading

Diff for: images/ECR/4.PNG

14.3 KB
Loading

Diff for: images/ECR/5.PNG

34.5 KB
Loading

Diff for: images/ECR/6.PNG

45.7 KB
Loading

Diff for: images/ECR/7.PNG

20.7 KB
Loading

Diff for: images/ECR/8.PNG

11.4 KB
Loading

Diff for: images/ECR/9.PNG

5.06 KB
Loading

0 commit comments

Comments
 (0)