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.
- Build container images from a
Docksmithfile - Support for
FROM,COPY,RUN,WORKDIR,ENV, andCMD - 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
- Python
- Linux
chroot- Tar archives
- Content-addressed storage
- Linux operating system
- Root privileges (required for
chroot) - Python 3.x
.
├── docksmith/
│ ├── build_engine.py
│ ├── cache.py
│ ├── isolation.py
│ ├── runtime.py
│ ├── storage.py
│ └── main.py
├── test-app/
├── README.md
└── .gitignore
Import a base image:
sudo python docksmith/main.py import-base demo-base:latest /path/to/rootfsBuild an image:
python docksmith/main.py build -t myapp:latest test-appRun a container:
sudo python docksmith/main.py run myapp:latestList images:
python docksmith/main.py imagesRemove an image:
python docksmith/main.py rmi myapp:latest- Requires Linux for build-time
RUNand runtime execution. - Uses
chrootfor isolation and therefore requires root privileges. - Supports local base image imports only.
COPYparsing is simplified and does not support quoted paths with spaces.- Does not implement Docker image whiteout files.
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.