[英]building a docker image in AWS with CLI
I was using gcloud
before and could build a docker image on a GCP machine as follows:我之前使用的是
gcloud
,可以在 GCP 机器上构建一个 docker 图像,如下所示:
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?是否有类似的 AWS 等价物?
No, there's no such alternative.不,没有这样的选择。 With AWS you use
docker
to build
& push
to ECR.使用 AWS,您可以使用
docker
build
并push
送到 ECR。
An example workflow would be:一个示例工作流程是:
docker
file and build it with:docker
文件并使用以下命令构建它:docker build -t hello-world .
aws ecr get-login-password --region region | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.region.amazonaws.com
aws ecr create-repository \
--repository-name hello-world \
--image-scanning-configuration scanOnPush=true \
--region region
docker tag hello-world:latest aws_account_id.dkr.ecr.region.amazonaws.com/hello-world:latest
docker push aws_account_id.dkr.ecr.region.amazonaws.com/hello-world:latest
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.