- Docker on Amazon Web Services
- Justin Menga
- 217字
- 2025-02-17 05:10:17
Inspecting the ECS agent
As shown previously, the ECS agent runs as a Docker container, and we can use the docker container inspect command to gather some insight about how this container works. In the previous example, we reference the name of the ECS agent container, and then use a Go template expression along with the --format flag to filter the command output, displaying the various bind mounts or volume mappings from the ECS agent container to the ECS container instance host.
> docker container inspect ecs-agent --format '{{json .HostConfig.Binds}}' | jq
[
"/var/run:/var/run",
"/var/log/ecs:/log",
"/var/lib/ecs/data:/data",
"/etc/ecs:/etc/ecs",
"/var/cache/ecs:/var/cache/ecs",
"/cgroup:/sys/fs/cgroup",
"/proc:/host/proc:ro",
"/var/lib/ecs/dhclient:/var/lib/dhclient",
"/lib64:/lib64:ro",
"/sbin:/sbin:ro"
]
Notice that the /var/run folder is mapped from the host to the agent, which provides access to the Docker Engine socket located at /var/run/docker.sock, allowing the ECS agent to manage the Docker Engine. You can also see that ECS agent logs will be written to /var/log/ecs on the Docker Engine host file system.