Skip to content

Installation Guide

Alessandro Placido Luise edited this page Nov 17, 2020 · 5 revisions

The following tutorial is tested for the latest Kali Linux distributions and also for Ubuntu with a small change. It will soon be provided a bash script that automatize the installation of the dependencies.

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

The installation of nodejs differs for Kali Linux and Ubuntu

Kali Linux :

sudo apt install nodejs

Ubuntu :

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get install -y nodejs
apt-get install -y build-essential

Install Docker and NPM

sudo apt install docker.io

sudo apt install npm

Make sure that you already have g++ installed and build-essentials.

sudo apt install g++

sudo apt-get update

sudo apt-get install build-essential

3 - Install Docker Compose and mydockerjs API

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

sudo curl -L "https://github.com/docker/compose/releases/download/1.23.1/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 and start

Go in DSP directory

cd DockerSecurityPlayground

Open a shell and install the packages required with npm

npm install express

npm install body-parser

npm install update

npm run update

npm install ws

The following cmd will start the application :

npm start

DSP is running on your machine. Now open any browser and go to http://localhost:8080 to be sure all went well.

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

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

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

Now close the file created with "cat" typing : EOF . If you have permissions problems with cat, enter in superuser mode with "sudo su"

sudo apt-get update

  • Configure Docker user group permissions

sudo groupadd docker

sudo gpasswd -a ${USER} docker

sudo service docker restart

  • Set Docker to auto-launch on startup

sudo systemctl enable docker