This is a starting point for Go solutions to the "Build Your Own Docker" Challenge.
In this challenge, you'll build a program that can pull an image from Docker Hub and execute commands in it. Along the way, we'll learn about chroot, kernel namespaces, the docker registry API and much more.
Note: If you're viewing this repo on GitHub, head over to codecrafters.io to signup for early access.
- Ensure you have
go
installed locally - Download
docker-explorer
, as mentioned here. - Follow the details below ("Running your program locally") to run your Docker
implementation, which is implemented in
app/main.go
. - Commit your changes and run
git push origin master
to submit your solution to CodeCrafters. Test output will be streamed to your terminal.
Since you'll need to use linux-specific syscalls in this challenge, we'll run your code inside a docker container.
docker build -t my_docker .
docker run --cap-add="SYS_ADMIN" my_docker run some_image /usr/local/bin/docker-explorer echo hey
(remember to re-run docker build
each time you make changes to your code!)
CodeCrafters runs tests when you do a git push
. Make an empty commit and push
your solution to see the first stage fail.
git commit --allow-empty -m "Running tests"
git push origin master
Go to app/main.go
and uncomment the implementation. Commit and push your
changes, and you'll now see the first stage pass.
Time to move on to the next stage!