How to stop and remove all Docker containers.
Stop all containers
$ docker kill $(docker ps -q) |
Remove all containers
$ docker rm $(docker ps -a -q) |
Delete all docker images
$ docker rmi $(docker images -q) |
cloud engineer
How to stop and remove all Docker containers.
Stop all containers
$ docker kill $(docker ps -q) |
$ docker kill $(docker ps -q)
Remove all containers
$ docker rm $(docker ps -a -q) |
$ docker rm $(docker ps -a -q)
Delete all docker images
$ docker rmi $(docker images -q) |
$ docker rmi $(docker images -q)
Amazon Elastic Container Registry (ECR) is a fully-managed Docker container registry that makes it easy for developers to store, manage, and deploy Docker container images.
Here’s the AWS IAM policy to push and pull images from Docker within ECR.
{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPushPull", "Effect": "Allow", "Resource": [ "arn:aws:iam::*:role/your-custom-role" ], "Action": [ "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage", "ecr:BatchCheckLayerAvailability", "ecr:PutImage", "ecr:InitiateLayerUpload", "ecr:UploadLayerPart", "ecr:CompleteLayerUpload" ] } ] } |
{ "Version": "2008-10-17", "Statement": [ { "Sid": "AllowPushPull", "Effect": "Allow", "Resource": [ "arn:aws:iam::*:role/your-custom-role" ], "Action": [ "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage", "ecr:BatchCheckLayerAvailability", "ecr:PutImage", "ecr:InitiateLayerUpload", "ecr:UploadLayerPart", "ecr:CompleteLayerUpload" ] } ] }
Here’s the command to create an image from an existing VM instance. You can create an image from disks, snapshots, images or from a cloud storage file. You can use images you built to launch and restore VM instances, as well as create Instance Templates.
gcloud compute --project=your-project images create your-server --source-disk=your-server --source-disk-zone=us-central1-c |
gcloud compute --project=your-project images create your-server --source-disk=your-server --source-disk-zone=us-central1-c