This is a simple Docker image intended to be used for local development of Linux programming homework assignments that typically run on a Centos server.
- Docker Hub
- GitHub
- More info about docker (from OSU's John McBride)
- Install Docker.
- Open a terminal.
- Navigate to your local assignment workspace:
cd ~/cs344/ - Create and run a container from the image:
docker run --rm -it -v "$(pwd):/workspace" -w "/workspace" --name os1 nathanperkins/os1 - Stop container with
exit
# navigate to your workspace and create the container
$ cd ~/git/osu-cs344/
$ docker run --rm -it -v "$(pwd):/workspace" -w "/workspace" nathanperkins/os1
# you are now inside the container and your workspace should be here as well
[root@2d51aa00977b workspace]# ls
README.md Vagrantfile assignment_1 assignment_2 assignment_3 assignment_4 assignment_py playground test
# exit the container
[root@2d51aa00977b assignment_2]# exit
exitLet's break down this command
$ docker run --rm -it -v "$(pwd):/workspace" -w "/workspace" --name os1 nathanperkins/os1
- docker run - creates and starts a new container from an image.
-it- runs the container in interactive mode and attaches a terminal.-v "$(pwd):/workspace"- uses docker volumes to map the current local directory to a directory inside the container. This allows you to use your local files inside the container and have the changes synced both ways.--rm- deletes the container itself and any anonymous volumes when done. This does not affect your workspace volume that was explicitly mapped above.-w "/workspace"- opens the container/workspaceas the current working directory.nathanperkins/os1- the name of the image on Docker Hub, found here