Saturday, July 26, 2025

Docker Image Registry (Local & Remote Storage) | Overview.


Docker Image Registry (Local & Remote Storage) - Overview.

Scope:

  • Intro,
  • Docker Images Stored Locally,
  • Additional locations inside /var/lib/docker/
  • where exactly locally are docker images stored in (linux, windows & macOs)
  • Where Docker Images Stored Remotely,
  • Basic Image management command,
  • Summary.

Intro:

  • Docker images are stored locally on twtech system by the Docker Engine, and remotely in registries like Dockerhub / Elastic Container Registry (ECR).
  • Here’s twtech detailed overview 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 image and container 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/

 NB: 

  • 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
  • Amazon ECR,  etc.

twtech Basic management 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$\...)

NB

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


No comments:

Post a Comment

Amazon EventBridge | Overview.

Amazon EventBridge - Overview. Scope: Intro, Core Concepts, Key Benefits, Link to official documentation, What EventBridge  Really  Is (Deep...