Skip to content

Asritha916/docksmith

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Docksmith

Docksmith is a lightweight Docker-inspired container runtime built in Python. It demonstrates the core concepts of containerization by building images from a Docksmithfile, storing content-addressed image layers, and executing applications inside isolated environments using chroot.

Features

  • Build container images from a Docksmithfile
  • Support for FROM, COPY, RUN, WORKDIR, ENV, and CMD
  • Content-addressed image layer storage
  • Build cache with optional cache bypass (--no-cache)
  • Process isolation using chroot
  • Environment variable support during runtime
  • Local base image import

Tech Stack

  • Python
  • Linux
  • chroot
  • Tar archives
  • Content-addressed storage

Requirements

  • Linux operating system
  • Root privileges (required for chroot)
  • Python 3.x

Project Structure

.
├── docksmith/
│   ├── build_engine.py
│   ├── cache.py
│   ├── isolation.py
│   ├── runtime.py
│   ├── storage.py
│   └── main.py
├── test-app/
├── README.md
└── .gitignore

Usage

Import a base image:

sudo python docksmith/main.py import-base demo-base:latest /path/to/rootfs

Build an image:

python docksmith/main.py build -t myapp:latest test-app

Run a container:

sudo python docksmith/main.py run myapp:latest

List images:

python docksmith/main.py images

Remove an image:

python docksmith/main.py rmi myapp:latest

Current Limitations

  • Requires Linux for build-time RUN and runtime execution.
  • Uses chroot for isolation and therefore requires root privileges.
  • Supports local base image imports only.
  • COPY parsing is simplified and does not support quoted paths with spaces.
  • Does not implement Docker image whiteout files.

Purpose

Docksmith was developed as an educational project to explore the internal mechanisms of container runtimes, including image building, layer management, caching, and process isolation. It is intended to demonstrate container runtime concepts rather than serve as a production-ready replacement for Docker.

About

Docker-inspired container runtime with layered image builds and chroot-based execution.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages