Saturday, July 26, 2025

Docker Image Registry | Local & Remote Storage.

 

Docker images are stored locally on twtech system by the Docker Engine, and remotely in registries like Docker Hub / Elastic Container Registry (ECR).

Here’s twtech detailed breakdown of both:

 1.  Docker Images:  Stored Locally

 Linux (default storage driver: overlay2)

Docker images are stored under:

# swift

/var/lib/docker/

Specifically, image layers and metadata are in:

# swift

/var/lib/docker/overlay2/

Additional locations inside /var/lib/docker/:

Directory

Purpose

overlay2/

Image layers (merged filesystems)

image/

Metadata about images

containers/

Running container data

volumes/

Volume data

network/

Network configuration

 macOS & Windows

Docker uses a lightweight VM (via Docker Desktop, WSL2 on Windows, or HyperKit on macOS). The images are stored inside the virtual machine, not directly on the host filesystem.

twtech can interact with them via Docker commands, but can't easily browse to them in Finder or File Explorer.

  • On Windows (WSL2):
    Images are stored inside the WSL2 virtual disk:

# kotlin

 

\\wsl$\docker-desktop-data\version-pack-data\community\docker\overlay2\

  • On macOS:
    Stored in a VM disk file, typically located at:

# bash

 

~/Library/Containers/com.docker.docker/

or inside:

# bash

 

~/Library/Containers/com.docker.docker/Data/vms/

 Note: Since twtech can’t interact with the actual image files directly, it uses Docker CLI to manage image files.

 2. Docker Images:  Stored Remotely

Public Registries:

  • Docker Hub (https://hub.docker.com)
  • GitHub Container Registry
  • Google Container Registry
  • Amazon ECR, Azure ACR, etc.

When twtech runs the following command:

# bash

docker pull twtechwebapp

Docker:

  1. Contacts Docker Hub.
  2. Downloads image layers.
  3. Caches them locally.

 3. Viewing Local Images

Use:

# bash

docker images       # To get more detailed info:

# bash

docker image inspect twtechspringbootapp   #To see where Docker’s data is stored:

# bash

docker info | grep Root  #To se the output one comand as the input for another.

Sample output:

# bash 

Docker Root Dir: /var/lib/docker

twtech Summary

Platform

Local Storage Path

Linux.

/var/lib/docker/overlay2/

macOS.

Inside Docker Desktop VM (~/Library/Containers/...)

Windows.

Inside WSL2/Docker Desktop VM (\\wsl$\...)

To manage or remove images, always use the Docker CLI (docker image rm, docker system prune, etc.).

No comments:

Post a Comment

Kubernetes Clusters | Upstream Vs Downstream.

  The terms "upstream" and "downstream" in the context of Kubernetes clusters often refer to the direction of code fl...