
Q-Bits: Docker ECR Push and Pull Operations with Amazon Q Developer
This blog post explores how Amazon Q Developer can help you efficiently manage container images
Frank Allotta
Amazon Employee
Published Jun 3, 2025
Welcome to another installment of Q-Bits, our regular series showcasing cool ways Amazon employees are leveraging Amazon Q Developer. Today, we're diving into how Amazon Q Developer can assist with efficiently managing container images with Docker ECR Push and Pull Operations.
In exploring the capabilities of Amazon Q Developer, I wanted to see if Q could assist me with Elastic Container Registry push and pull operations. For those familiar with Docker images and ECR, this may not be a difficult task. But what about someone who is starting from square one and needs some assistance? Or maybe I want Q to bootstrap the process for me to save time? Can Q help me accomplish this?
In the following sections I will showcase how Amazon Q Developer helped me create an ECR repository, push and pull containers to and from the repo, explained repository policy configurations, demonstrated image scanning and tag mutability, and provided examples of cross-account image sharing.
For this exercise I used Visual Studio Code as the IDE with the Amazon Q Developer extension. All prompts were entered into Amazon Q Chat.
I already had a basic Dockerfile that creates a container image for a simple Hello World application. I also built the image using commands suggested by Amazon Q Developer. For reference, below is Dockerfile I used, the python file called hello-qbits.py that serves as the app, and the docker build commands suggested by Amazon Q Developer when I asked "how do I build my docker image?"
So what is the process to get this image into ECR? Let's ask Q for the process beginning with the following prompt.
As you can see in the prompt, I also asked Q to format the response in markdown format and write it to a file. The reason for this is that I am using Visual Studio Code. VSCode has a built in feature that allows you to preview a file. If the file is in markdown format it is a clean way to view the file as if you were reading a REAME.md file in GitHub. That said, after I ran my prompt, Q responded with the following markdown file that includes all of the prerequisites as well as the steps with required aws cli commands and docker push commands.
Next I wanted to know more about ECR repository policy configurations and what they are for. Once again I ask Q for assistance by explaining what they are?
When Q responds to this, it remembers that I like my output in markdown format and creates a file called ecr-policy-configurations.md. It includes an explanation of policy configuration along with common policy examples. Notice this has already has an example of Cross Account Sharing.
Now that we know about ECR repository policy configuration, I wanted to know a bit more about image scanning and tag mutability. For this I asked Amazon Q Developer to go into more detail.
After prompting, Amazon Q Developer once again remembers my preference for markdown formatted files and modifies the ecr-policy-configurations.md file to include more information on image scanning and tag mutability. It also provides the necessary aws cli commands to enable scanning on push as well as manual scanning. Below is the resulting markdown file.
The final piece of the puzzle would be to be able to pull the image from the ECR repo. Once again, I provide Amazon Q Developer a prompt to provide me the aws cli commands to pull the image from the ECR repo and add the output to the ecr-guide.md file I created earlier.
As demonstrated in this post, Amazon Q Developer was able to help me create an ECR repository, push and pull containers to and from the repo, explained repository policy configurations, demonstrated image scanning and tag mutability, and provided examples of cross-account image sharing.
As a bonus, Amazon Q Developer was able to understand my preference for outputting results in a clean and readable markdown format. Furthermore, it was able to document every single command so I could understand what each command does and provided tips along the way.
Amazon Q Developer is a powerful AI assistant that can help speed up your development process whether you are a beginner that wants detailed step by step instructions with examples, or you are a seasoned developer that wants to quickly bootstrap a project.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.