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 aws_account_id.dkr.ecr.region.amazonaws.com

docker pull aws_account_id.dkr.ecr.us-east-1.amazonaws.com/aws-cdk/assets:tag

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

CONTAINER_ID=$(docker create aws_account_id.dkr.ecr.us-east-1.amazonaws.com/aws-cdk/assets:tag)

docker export -o dockerfs.tar $CONTAINER_ID

mkdir dockerfs
cd dockerfs

tar -xf ../dockerfs.tar