I was using gcloud
before and could build a docker image on a GCP machine as follows:
gcloud builds submit ./my-docker-dir/ -t eu.gcr.io/<path>/<component>:<tag> --timeout 30m --machine-type e2-highcpu-32\n
Is there a similar AWS equivalent?
CodePudding user response:
No, there's no such alternative. With AWS you use docker
to build
& push
to ECR.
An example workflow would be:
- Create a
docker
file and build it with:
docker build -t hello-world .
- Authenticate your Docker client to the Amazon ECR registry to which you intend to push your image.
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
- Create an ECR repository
aws ecr create-repository \
--repository-name hello-world \
--image-scanning-configuration scanOnPush=true \
--region region
- Tag the docker image you've built.
docker tag hello-world:latest aws_account_id.dkr.ecr.region.amazonaws.com/hello-world:latest
- Push it to your ECR repo.
docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-world:latest