-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created HowToPushImageToECR Markdown
- Loading branch information
1 parent
849540b
commit b0ec1e2
Showing
11 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.