-1

I have found a docker image that has everything i need to setup my application but its large to download so that's why i'm trying to download it to AWS ECR so that the build process can speed up is there any way i can pull docker image and use that as a base to build my own?

Thanks

Saif Ali
  • 429
  • 5
  • 23
  • 1
    Well, you have to use a base image. I don't understand the question. Of course, you can use any base image to build on top of it. That's one key point of docker. – The Fool Apr 11 '20 at 09:57

1 Answers1

2

You can pull the image and push it to AWS ECR. You need to create the repo in AWS first. enter image description here

# Tag your image so you can push the image to this repository
docker tag <image_name>:latest <account_id>.dkr.ecr.<region>.amazonaws.com/<repo_name>:latest
# Push this image to your AWS repository
docker push <account_id>.dkr.ecr.<region>.amazonaws.com/<repo_name>:latest

Yes, you can use any image as base image. You can use the image you push to AWS ECR too, at the top of your Dockerfile add below code:

FROM <account_id>.dkr.ecr.<region>.amazonaws.com/<repo_name>:<image_tag>
xwlee
  • 1,083
  • 1
  • 11
  • 29