Skip to content

Installation Guide Ubuntu

Alessandro Placido Luise edited this page Mar 30, 2021 · 1 revision

The following tutorial is tested on Ubuntu 20.10 distribution, but it should work fine for all previous versions.

1 - Clone Docker Security Playground from GitHub

If you haven't installed Git, open a shell and type : sudo apt-get install git

Clone DSP repository with :

git clone https://github.com/giper45/DockerSecurityPlayground.git

A repository with DSP has now been created in your main folder ( root/DockerSecurityPlayground )

2 - Install prerequisites libraries

sudo apt-get update

Install docker

sudo apt install docker.io

Enable docker and check if the installation was successful

sudo systemctl start docker

sudo systemctl enable docker

docker --version

Install essential libraries, nodejs and npm

sudo apt-get install build-essential

sudo apt-get install nodejs

sudo apt-get install npm

3 - Install Docker Compose and mydockerjs API

Download the Docker Compose binary into the /usr/local/bin directory

sudo apt-get install curl

sudo curl -L "https://github.com/docker/compose/releases/download/1.28.6/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Apply executable permissions to the Compose binary

sudo chmod +x /usr/local/bin/docker-compose

Download mydockerjs API, a javascript utility library for docker and docker-compose, it provides a simple javascript wrapper in order to execute docker commands and an api in order to use Docker with a node server.

npm install --save mydockerjs

4 - Install NPM libraries

Go in DSP directory

cd DockerSecurityPlayground

Install the required packages with npm

npm install

5 - Last measures

This last section shows how to add a docker repo and configure docker to autolaunch on startup (otherwise you will get a socket error when you launch "npm start" since the first time).

  • Add Docker repo

sudo apt-get install -y apt-transport-https ca-certificates

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Enter superuser mode

sudo su

cat > /etc/apt/sources.list.d/docker.list <<'EOF'

Write this line inside the source list file

deb https://apt.dockerproject.org/repo debian-stretch main

Now close the file created with "cat" typing : EOF

sudo apt-get update

If you get some errors during the apt-get update operation ignore them and continue the with the next steps.

sudo groupadd docker

sudo gpasswd -a ${USER} docker

Run also

sudo usermod -aG docker $USER

newgrp docker

Restart and set Docker to auto-launch on startup

sudo service docker restart

sudo systemctl enable docker

IMPORTANT! Logout and login again with your user and you will be able to launch DSP with

npm start

Chose your username and click install, then wait for the laboratories to download. Happy hacking.