Menu
Amazon EC2 Container Service
Developer Guide (API Version 2014-11-13)

Pushing Windows Images to Amazon ECR

You can push Windows Docker container images to Amazon ECR. You must be using a version of Docker that supports Windows containers. The following procedures show you how to pull a Windows Docker image, create an Amazon ECR repository to store the image, tag the image to that repository, authenticate the image to the Amazon ECR registry, and then push the image to that repository.

To pull and tag a Windows Docker image

  1. Pull a Windows Docker image locally. This example uses the microsoft/iis image.

    Copy
    PS C:\> docker pull microsoft/iis Using default tag: latest latest: Pulling from microsoft/iis 3889bb8d808b: Pull complete 04ee5d718c7a: Pull complete c0931dd15237: Pull complete 61784b745c20: Pull complete d05122f129ca: Pull complete Digest: sha256:25586570b058da9882d4af640d326d0cc26dfd60b67e1cee63f35ea54d83c882 Status: Downloaded newer image for microsoft/iis:latest

  2. Create an Amazon ECR repository for your image.

    Copy
    PS C:\> aws ecr create-repository --repository-name iis { "repository": { "registryId": "111122223333", "repositoryName": "iis", "repositoryArn": "arn:aws:ecr:us-west-2:111122223333:repository/iis", "createdAt": 1481845593.0, "repositoryUri": "111122223333.dkr.ecr.us-west-2.amazonaws.com/iis" } }

  3. Tag the image with the repositoryUri that was returned from the previous command.

    Copy
    PS C:\> docker tag microsoft/iis 111122223333.dkr.ecr.us-west-2.amazonaws.com/iis

  4. Authenticate your Docker client to the Amazon ECR registry.

    Copy
    PS C:\> Invoke-Expression -Command (aws ecr get-login)

  5. Push the image to Amazon ECR.

    Copy
    PS C:\> docker push 111122223333.dkr.ecr.us-west-2.amazonaws.com/iis The push refers to a repository [111122223333.dkr.ecr.us-west-2.amazonaws.com/iis] 1e4f77a75bd4: Pushed ac90fb7da567: Pushed c7090349c7b3: Pushed b9454c3094c6: Skipped foreign layer 3fd27ecef6a3: Skipped foreign layer latest: digest: sha256:0ddc7af8691072bb2dd8b3f189388b33604c90774d3dc0485b1bf379f9bec4c5 size: 1574