Know How Guide and Hands on Guide for AWS
docker pull nginx
docker images
aws ecr create-repository --repository-name nginx --region ap-southeast-1 --profile global
docker tag nginx:latest aws_account_id.dkr.ecr.ap-southeast-1.amazonaws.com/nginx:latest
aws ecr get-login-password --region ap-southeast-1 --profile global | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.ap-southeast-1.amazonaws.com/nginx
docker push aws_account_id.dkr.ecr.ap-southeast-1.amazonaws.com/nginx:latest
Step 2: Create task definition and AppSpec source files and push to a CodeCommit repository
aws ecs register-task-definition --cli-input-json file://taskdef.json --region ap-southeast-1 --profile global
After the task definition is registered, edit your file to replace the nginx
back to <IMAGE1_NAME>
placeholder text in the image field.
To create an AppSpec file appspec.yaml
aws ecs create-service --service-name my-service --cli-input-json file://create-service.json --region ap-southeast-1 --profile global
aws ecs describe-services --cluster ecs-demo --services my-service --region ap-southeast-1 --profile global
MyECSDemoApplication
with ECS compute platformECS-pipeline
CodeCommit
, Repository: MyECSDemo
, Branch: master
ECR
, Repository: nginx
MyNginxImage
MyECSDemo
git clone ssh://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/MyECSDemo
git add .
git commit -m "Adding container build specification."
git push
hello-world
with hello-world ECR image and map to 9080 port
aws ecr create-repository --repository-name hello-world --region ap-southeast-1 --profile global
cd webpage-demo
docker build . -t hello-world:latest
docker tag hello-world:latest aws_account_id.dkr.ecr.ap-southeast-1.amazonaws.com/hello-world:latest
aws ecr get-login-password --region ap-southeast-1 --profile global | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.ap-southeast-1.amazonaws.com/hello-world
docker push aws_account_id.dkr.ecr.ap-southeast-1.amazonaws.com/hello-world:latest
aws ecs create-service --service-name hello-world --cli-input-json file://create-service-hello-world.json --region ap-southeast-1 --profile global
aws ecs describe-services --cluster ecs-demo --services my-service --region ap-southeast-1 --profile global
ECS-pipeline
CodeCommit
, Repository: MyECSDemo
, Branch: master
webpage-demo
directory