Not all computers can run Docker - don't panic if your computer can't run Docker. There are other ways to work on COMP1511 on your own computer - almost any computer can be used to work at home.
Docker requires a 64-bit operating system (you can't run it on 32-bit versions of Windows). You also need 4+ Gb of memory (RAM) to run Docker.
You will need to download a Docker image of 200 megabytes - be careful if you have a limited internet quota. If you don't have a large internet quota at home you may be able to download Docker images via Uniwide while you are at UNSW.
If you are running Windows 10 Home it may be possible to upgrade using just the Windows 10 education key avoiding a 3Gb download of Windows 10 education.
Follow the instructions for installing Docker (stable or beta should be fine). Note Docker will enable Hyper-V which may cause problems if you run VirtualBox.
After Docker is installed you need to enable access to your local drive via Docker settings enable access to your local drive via Docker settings (click on the Docker Icon in the System Tray)
If your machine has less than 8Gb of memory you probably want to reduce the amount of memory used by Docker to the minimum (1 Gb) in Docker Settings as well.
Then open a Command Prompt
or PowerShell
Then enter the Docker commands below.
Hints to be added here (contributions welcome)
Starting Docker and mounting volume is different (and a little more complicated) using Docker toolbox.
After installing Docker Toolbox, click on the shortcut for Docker Quickstart terminal
to run it:
## . ## ## ## == ## ## ## ## ## === /"""""""""""""""""\___/ === ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~ \______ o __/ \ \ __/ \____\_______/ docker is configured to use the default machine with IP 192.168.99.100 For help getting started, check out the docs at https://docs.docker.com Start interactive shell andrewt@DESKTOP-D5CH4U3 MINGW64 ~
then enter the Docker commands below.
Hints to be added here (contributions welcome)
Hints to be added here (contributions welcome)
C:\users\andrewt>docker run hello-world Hello from Docker! ...You will need to mount your directory into Docker to do any work, so test if this works.
The command line option -v /c/Users/andrewt:/root
causes the local directory /c/Users/andrewt
to be mounted in the container as /root
. You'll need to change the andrewt
part of course.
C:\users\andrewt>docker run -v /c/Users/andrewt:/root alpine ls /root AppData Application Data Contacts Cookies Desktop Documents Downloads ...If you don't see any files make check you have the right directory name.
Beware this will involve a 150Mb download the first time you run it, and take several minutes.
Don't forget the -it command line argument - you need that to use Docker interactively.
C:\Users\andrewt>docker run -it --cap-add=SYS_PTRACE -v /c/Users/andrewt:/root comp1511/sh Welcome to the COMP1511 Docker command-line tools & scripts container You can fetch any recent changes to autotest files from CSE (1-2Mb). by running: update_files You can also fetch the latest version of this image (beware can be 100+Mb if there have been major changes) by running: docker pull comp1511/sh Enter your zid: 5555555 Storing z5555555 in /root/.zid You don't seem to have a ssh key. Assumin this is your own computer you might like to create a ssh key by running this command (just hit return for the questions): ssh-keygen You can then copy it to CSE using this command: ssh-copy-id z5555555@cse.unsw.edu.au Docker$ ls -l orca.c -rw-r--r-- 1 517 517 2947 Jun 6 10:53 orca.c Docker$ dcc orca.c Docker$ autotest orca dcc -Dmain=_main orca.c test_orca.c -o test_orca dcc --valgrind -Dmain=_main orca.c test_orca.c -o test_orca Test 0 (./test_orca whales.txt) - passed Test 1 (./test_orca whales1.txt) - passed Test 2 (./test_orca whales2.txt) - passed 3 tests passed 0 tests failed Docker$ ssh z5555555@cse.unsw.edu.au z5555555@cse.unsw.edu.au's password:You'll find convenient for
ssh
and give
to create
an ssh key.
Docker$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 86:e3:0e:9f:0d:40:fe:69:14:9a:8a:63:94:b7:61:b3 root@f17f24b3acb7 The key's randomart image is: +---[RSA 2048]----+ | | | | | . . | | .o o o | | o == + S | |..o.== + | |o..E. * | |.. = + | | + . | +-----------------+ Docker$ ssh-copy-id z5555555@cse.unsw.edu.au RSA key fingerprint is 23:d5:37:a9:29:3c:b8:4f:01:e6:ae:93:82:6c:22:8c. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys z5555555@cse.unsw.edu.au's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'z5555555@cse.unsw.edu.au'" and check to make sure that only the key(s) you wanted were added.The
ssh-copy-id
command will have added your ssh key to
the .ssh/authorized_keys
file for your CSE account.
This will make it easy for you run give from the container.
Docker$ give COMP1511 lab01 bad_pun.c bird.c kangaroo.c Uploading to a temporary directory at CSE: bad_pun.c bird.c kangaroo.c Warning: Permanently added 'zappa.cse.unsw.edu.au,129.94.242.68' (RSA) to the list of known hosts. Upload completed Running give COMP1511 lab03 bad_pun.c bird.c kangaroo.c Session: 18s1 ...