This repo setups a simple dev environment for CSCI 353 projects with Docker.
After pulling the Docker image from Docker Hub, you should be able to use the
run.sh
or run.ps1
script to start, stop, and work in a virtualized
environment all from your command line.
This repo is also based off of Cameron Durham's cs350-docker project.
This Docker image has been tested and verified to be functioning correctly on the following platforms:
- Debian Sid, CentOS 8, Arch Linux
Please help me add more as you try them out by submitting a PR or an issue!
- Visual Studio Code with the Remote Containers extension
- JetBrains CLion with the Makefile extension or CMake integration
- NeoVim with coc.nvim and extra patience
The instructions below will walk you through running the setup script and the run script you'll use to access the csci350 environment.
-
Install Docker desktop from the website
- Windows Users Only: Docker provides better performance using WSL 2 than legacy Hyper-V. Set up WSL 2 using Microsoft's guide here. After you have WSL 2 running, refer to the screenshots at the end of this readme for settings you have to enable in Docker Desktop app.
- Linux Users Only: Install Docker engine from here, and Docker Compose from here
-
Clone this repository.
-
Specify your desired mount location (i.e. your
xv6
project folder)
Windows users only
Make sure you run this in an Admin PowerShell to let you run scripts:
# must execute this in admin powershell and select [A] to run scripts
Set-ExecutionPolicy RemoteSigned
-
Modify the
work
variable at the top of the run script in the project folder. For example:macOS/Linux:
# in run.sh work=~/projects/cs353/lab1data/
Windows Powershell:
# in run.ps1 $work="C:\Users\Username\cs353/lab1data"
Windows Terminal using WSL2:
work=/mnt/c/Users/Username/cs353/lab1data
-
Run the
run.sh
/run.ps1
script. If this is your first time starting, this will pull the Docker image. This image will be cached until there's a new image available or you manually remove it.macOS/Linux/Windows Terminal (WSL2):
./run.sh start
Windows Powershell:
.\run.ps1 start
This script is only a wrapper for some simple Docker commands.
To start up a Linux shell inside the Docker image, you'll want to start a terminal session inside the Docker image:
macOS/Linux/Windows Terminal (WSL2):
./run.sh shell
Windows Powershell:
.\run.ps1 shell
After you're done working in the environment, you might want to stop the container. Don't worry if you forget to do this, since Docker Desktop will automatically and safely stop running containers when you shutdown your computer.
macOS/Linux/Windows Terminal (WSL2):
./run.sh stop
Windows Powershell:
.\run.ps1 stop
Below are the system requirements for Docker Desktop:
- Windows 10 64-bit: (Build 15063 or later)
- Pro, Enterprise, or Education: using Hyper-V and Containers Windows features
- Any Windows 10 version: using WSL2 container backend (recommended)
If you are using Windows 10 Home, you can obtain a "free" license for Windows 10 Education here.
- Mac hardware must be a 2010 or newer model
- macOS must be version 10.13 or newer
- 4 GB RAM minimum
- Use the Docker-provided install instructions if it exists for your distro, otherwise