This first bit is specific to pulling a docker image from ECR. The second part is the same regardless of where you’re pulling the image from.

aws ecr get-login-password --region region | docker login --username AWS --password-stdin

docker pull

Once you have the image on your local machine, you create a container from it and export the file system.

CONTAINER_ID=$(docker create

docker export -o dockerfs.tar $CONTAINER_ID

mkdir dockerfs
cd dockerfs

tar -xf ../dockerfs.tar