Docker Environment

The course is setup to use Docker; this helps reduce the burden of unifying working environments and prepares you for using state-of-the-art development techniques.

Introduction

Docker containers are like virtual machines, but integrated more tightly into the host OS and therefore they incur less overhead - both in space on your disk, and in memory requirements to run several containers simultaneously.

Read up on Docker and lightweight containers at the basic docker overview.

How to use Docker

It’s 2021, but we are still in lockdown (don’t get me started)

The very best approach is to bite the bullet now, and make Docker work on your own machine. This will actually turn out very handy for a wide variety of tasks involving computers, and has the potential to ease your online life a lot.

If you are really unsuccessful in making this work, or do not own a computer that is sufficiently powerful (say, 8G memory and 20GB free disk, though it’s no more than a wild guess), contact me in the [lab sessions Matrix room][matrix] and we will find a fallback option involving remote access to the computers in the terminal rooms. But it has its own drawbacks, so see what you can do first.

Setting up Docker

DIY Linux

Follow the instructions to download the Docker Engine (aka community edition).

Note: Docker has become more and more professional (read: commercial) since the course started - you will not need anything beyond the free community edition for the course, but they may try to make you install paid products.

Personally, I use the open source alternative for Docker called podman, which is a (better) alternative on Linux; especially if you use Fedora 31 or newer.

DIY Windows

If you use a Windows 10 computer, setting up Docker with WSL(2) is slightly more work, but worth the effort.

The official Microsoft WSL2 documentation has all the information you need (and more…), maybe the blog post linked below is a quicker option.

First, you may need the Hyper-V extension that is only available in Windows 10 Pro - luckily, the Windows 10 Education edition includes this too! Upgrade to Windows 10 Education via Surfspot (free for students).

You may now need to explicitly activate Hyper-V.

Combining Docker on Windows with WSL2 (Windows Subsystem for Linux) is covered well in the following blog post/instruction video:

WSL(2) is useful for many more reasons than just this course! Do keep in mind when searching online that there’s an older version of Windows Subsystem for Linux, WSL(1); always make sure that you follow the instructions for WSL2.

If you have an older version of Windows… I suggest to 1) upgrade Windows, 2) setup dual boot to Linux, or 3) use a virtual machine with, in that order of preference.

PS: on my laptop, I followed this blog to use Emacs under WSL2, but the video above is most likely more useful for most.

DIY MacOS

Unfortunately, I have no Apple devices other than a very old MP3 player…

Please tell me in your blogpost how things work out if you just follow the Docker on MacOS instructions given by Docker.

A detailed report may make it into the 2022 edition of the course!

Using Docker

For a minimal test to verify that the Docker client can start so-called containers correctly:

docker run hello-world

The output helps you understand what happened, provided things worked out alright.

Continue with assignment 1 part III and use Docker to practice your Scala!

If things did not work out, come find us on Matrix… Of course, if things worked out for you but you recognize a problem asked about, feel free to answer those questions from fellow students as well - it would be really nice if everyone can proceed through this stage most efficiently.

Back to Assignment / 1.