-
Notifications
You must be signed in to change notification settings - Fork 0
Setting Up Docker Desktop
Docker Desktop is a convenient GUI tool for managing docker containers, images, and volumes. These are out of the scope for CS2030, but we will be using a prepared docker image that makes setting up the development environment easier. For those who are keen, you may refer to the documentation to learn more about dockers (Hint: you can also write about it on the wiki).
You can download Docker Desktop Installer for Mac, Windows, and Linux from this link. Make sure you download the version for your OS (and chip type for Mac users). After downloading, you can install Docker Desktop by following the installation wizard of the Installer.
Open command prompt on Windows or Terminal on Mac and run the following:
docker pull ghcr.io/nus-cs2030/cs2030:latest
Note you may need to login to the container registry on github with your github credentials. See the Windows screenshot below for example.
Here is what it looks like in Windows:


Here is what it looks like in Mac:


After the image has been pulled you should be able to see it in Docker Desktop under images:

To boot up the coding environment, click on the run button in Images tab:

Open up optional settings. You should see that you will need to name your container and map volumes.

Create a folder specially for storing CS2030 codes on your OS filesystem (anywhere you like), and use the 3 dots icon on the "Host Path" field to browse and select the folder you just created.
Next type in /workspace
in the "Container Path" field.
Your configuration should be something like this:

Click on "Run", and you should see the container running:

Once your container is running, you can enter its unix environment by opening up a Command Prompt/Powershell, or Terminal (in Mac), and typing the following command:
docker exec -it -w /workspace CS2030 /bin/bash
Here is what it looks like in Windows:

Here is what it looks like in Mac:

Once inside, you can fire up Vim or Jshell and start coding, or compile and run your code with javac
and java
. Remember to save your files to /workspace
so you can access it from outside the container, or your work might be lost when the container stops.
To exit back out to the Command Prompt (Windows) or Terminal (Mac/Linux), you can just type exit
.
After restarting your computer, just start Docker Desktop again and run the container again. You can then access the container with the docker exec
command above.
Have fun!
Welcome to CS2030 AY22/23 Sem 1 Wiki