Docker on Amazon Web Services
上QQ阅读APP看书,第一时间看更新

Inspecting the local Docker environment

As you might expect, your ECS container instance will have an active Docker Engine running, which you can gather information about by running the docker info command:

> docker info
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 2
Server Version: 17.09.1-ce
Storage Driver: devicemapper
Pool Name: docker-docker--pool
Pool Blocksize: 524.3kB
Base Device Size: 10.74GB
Backing Filesystem: ext4
...
...

Here you can see the instance is running Docker version 17.09.1-ce, using the device mapper storage driver, and currently has a single container running.

Let's now take a look at the running container by executing the docker container ps command:

> docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS NAMES
a1b1a89b5e9e amazon/amazon-ecs-agent:latest "/agent" 36 minutes ago Up 36 minutes ecs-agent

You can see that the ECS agent actually runs as a container called ecs-agent, which should always be running on your ECS container instances in order for your ECS container instance to be managed by ECS.