Setting up a Virtual Machine via Docker
COP-3223
Table of Contents
1. Overview
This guide will walk you through setting up a GNU/Linux installation in a virtual machine on your own machine. This can be useful if you have connection issues with eustis. All submissions, however, will still be via git on eustis, although connecting and submitting to eustis can be done from within the virtual machine.
2. Install Docker
You only need do this once for the entire semester.
3. Create a directory on your local machine.
You only need do this once for the entire semester.
- Open a terminal on your machine. This depends on your operating system. See the guides on connecting to an SSH server for how to access the terminal on your operating system. This guide assumes the built-in Terminal application for MacOS and powershell for Windows.
Navigate to a directory to store your course directory.
cd ~
On windows this requires using powershell. Otherwise, navigate to your home folder under
Documents and Settings.Create your course directory.
mkdir cop3223h
Enter your course directory
cd cop3223h
Create a directory to hold your assignments, but do not change directory. Stay in the current directory.
mkdir -p assignments
4. Download the docker image
You only need do this once, but it can be redownloaded if the instructor makes changes to the Dockerfile.
Be sure you are in your cop3223h directory. Type
pwd
and be sure it is your .../cop3223h directory created in the last step.
Download the Dockerfile.
curl https://www.cs.ucf.edu/~gazzillo/teaching/cop3223hfall26/files/Dockerfile > Dockerfile
On Windows, if curl does not work, you may be able to use:
Invoke-WebRequest -Uri "https://www.cs.ucf.edu/~gazzillo/teaching/cop3223fall26/files/Dockerfile" -OutFile "Dockerfile"
5. Build the docker image
You only need do this once, but it can be rebuilt if the instructor makes changes to the Dockerfile.
Be sure you are in your cop3223h directory.
Build docker with
docker build -t cop3223h .
6. Run the docker image
You will do this every time you want to work on assignments.
docker run -it -v "${PWD}/assignments/:/assignments" cop3223h
You should then see a command prompt that looks something like this, although with different characters between the @ and :.
ubuntu@0c460dcf7994:/assignments$
7. Exiting the docker image
Once you are finished using the virtual machine, exit with
exit