Understanding AWS EFS and Where Docker Stores Container Status

Persistent Block Storage

What is EFS?

Amazon Elastic File System (EFS) is a fully managed, scalable, and elastic file storage service provided by AWS. It allows multiple EC2 instances, Kubernetes pods, or other AWS services to share the same file system over NFS (Network File System).

Key Features:

  • Fully managed: AWS handles scaling, backups, and maintenance.
  • Elastic scaling: Grows and shrinks automatically based on demand.
  • Multi-AZ availability: Provides high availability and durability.
  • Shared access: Multiple EC2 instances, ECS tasks, or Kubernetes pods can access the same file system.
  • Pay-as-you-go pricing: Billed based on storage usage.

Use Cases:

  • Shared file storage for EC2 instances.
  • Persistent storage for Docker containers running in ECS or Kubernetes (EKS).
  • Storing logs, backups, or machine learning datasets.

Where is Docker Container Status Stored?

Docker container status and metadata are stored in different places depending on the storage driver and runtime.

1. On the Host Machine (Default Storage Path)

  • The status of Docker containers (running, stopped, exited, etc.) is stored in: /var/lib/docker/containers/
  • Each container gets a unique UUID directory where its metadata is stored.

2. Docker Metadata & Configuration Files

  • Container logs, configs, and state are stored in: /var/lib/docker/containers/<container_id>/config.v2.json
  • This file contains the status, mount points, restart policies, and more.

3. Using Docker CLI to Check Status

You can check the status of running containers using:

docker ps

For all containers (running and stopped):

docker ps -a

4. If Using Docker with Kubernetes

  • Kubernetes stores container status in etcd (a distributed key-value store).
  • You can check container status using: kubectl get pods kubectl describe pod <pod_name>

About Anant 443 Articles
Senior technical writer