Build your own Docker

Build your own Docker

Learn about chroot, kernel namespaces, the docker registry API and more
Difficulty
Medium
Attempts
321
Supported Languages
C
Go
Nim
PHP

Introduction

In this challenge, you’ll build a toy Docker implementation that can pull an image from Docker Hub and execute commands in it. Along the way, you’ll learn about chroot, kernel namespaces, the docker registry API and much more.

Testimonials

Stages

Execute a program
#1

In this stage, you’ll execute a program using fork + exec.

321 completions
Wireup stdout & stderr
#2

In this stage, you’ll relay the child program’s stdout & stderr to the parent process.

182 completions
Handle exit codes
#3

In this stage, you’ll wait for the child program’s exit code and exit with it.

174 completions
Filesystem isolation
#4

In this stage, you’ll restrict a program’s access to the host filesystem by using chroot.

100 completions
Process isolation
#5

In this stage, you’ll restrict a program’s access to the host’s process tree by using PID namespaces.

86 completions
Fetch an image from the Docker Registry
#6

In this stage, you’ll fetch an image from Docker Hub and execute a command in it. You’ll need to use the Docker Registry API for this.

53 completions