This project implements restricted versions of Linux container primitives and provides a miniature docker-like utility to run containers on xv6.
Report link: report
- Clone the repo
git clone https://github.com/HehBot/CS695-A04
cd CS695-A04
- Now xv6 can be run either natively or in a Docker container.
- To run natively:
sudo make run
- To run in a Docker container:
sudo make docker-build
sudo make docker-run
This starts up a terminal in xv6.
- Press
Ctrl-a + x
to exit the xv6 terminal
- Once inside xv6 terminal, first execute
$ conductor init
to setup the containers folder.
- Now
conductor run <image> <command> [args...]
can be used to run any command inside a container based on given.
For example, following command runs ps command inside a contatiner based on sample image which is present by default in images folder.
$ conductor run sample ps
conductor exec <pid> <command> [args...]
can be used to run a command inside an already running container.
For example, here a container is created which runs container_init
which is a command that never ends in background by appending &
at the end of command. Next it exec ps
command into that container
- Execute
conductor stop <pid>
to stop container and delete it's folder.
Inspect the script CS695-A04/uprogs/prepare_sample_image.sh
and to make a similar custom script which makes new folder inside fsroot/image
and copies required files into it. Add the custom script under all:
in CS695-A04/uprogs/Makefile
On running xv6 the image folder will now be present inside /image folder.
This repo was forked from xv6-net. This project was implemented as a part of Assignment-4 of CS695 Cloud computing and Virtualization course.
Contributors: Arnav Aditya Singh (210050018), Kevin Prafull Baua (210050084)