Docker-Compose Installed on WSL (Ubuntu 20.04)

<< Click to Display Table of Contents >>

Raynet One Technology Catalog > 14.0 > Installation Guide > Preparation and Installation 

Docker-Compose Installed on WSL (Ubuntu 20.04)

The usage of WSL requires less resources such as CPU, memory, and storage than a full virtual machine. It allows for the usage of both, Windows and Linux command lines, in the same session.

 

The whole installation process and setup is divided into several parts:

 

Installation of Ubuntu

Installation of Docker-compose

Pulling the image and logging in into Raynet One Technology Catalog

 

Preparation:

Download the docker-compose.yml file from the Raynet One Technology Catalog Github Repository.

 

Ubuntu Installation:

1.Open PowerShell as administrator and run:

wsl --install

 

This command will initialize the following:

Virtual Machine Platform

Windows Subsystem for Linux installation

Linux kernel download and its installation

Ubuntu (as a default Linux distribution) download

 

Powershell wsl installation

 

2.Open "Turn Windows features on or off".

 

turn windows features on or off

 

3.Make sure the Hyper-V, Windows Subsystem for Linux, Virtual Machine Platform, and Windows Hypervisor Platform options are checked.

 

InstallationWindowsFeatures_HyperV
InstallationWindowsFeatures

 

If the options are not checked, turn them on and reboot the system.

 

4.After the reboot, Ubuntu will open automatically and start the installation. In order to finish the Ubuntu installation, set a UNIX username (small letters only) and password.

 

Example:

UNIX username: test

Password: test

 

Setting_Ubuntu_credentials

 

If the installation has been successful, the screen should look similar to the following example:

 

Ubuntu ready

 

When the installation of Ubuntu has been completed, continue with the installation of docker-compose.

 

Docker-Compose Installation:

The docker-compose installation is executed using Ubuntu prompt.

 

1.First update the default repository to ensure the latest docker-compose will be downloaded:

sudo apt update

 

sudo apt update

 

2.Upgrade the system to ensure all local packages and programs are up to date:
sudo apt upgrade
 

papercliper

Note:
While upgrading, the system will ask for additional disk space. Type y to continue.

 

3.To download the binary package using a URL curl is needed. In order to check if this command-line utility is available, type curl into the terminal window. It is possible to install curl immediately by typing sudo apt install curl in the terminal window.
 

4.After the system has been updated and curl is available for use, download and install Docker-Compose. Once the package is locally available it is automatically installed. Use the following command:

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

 
Download the latest docker version
 

5.Make the downloaded file executable by changing the file permission using the following command:

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

6.Reboot the system.
 

Check the docker-compose version. To check if the Docker-Compose version is correct use the following command:

sudo docker-compose --version

 

The version of Docker-Compose should be 1.29.2.

 

version of docker

 

Run Docker using the following command:

sudo systemctl daemon-reload
 

finger1

Be aware:
If the following or a similar error occurs, more commands are needed:

“System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down”

 

Execute the following commands:

sudo apt-get update && sudo apt-get install -yqq daemonize dbus-user-session fontconfig

 

sudo daemonize /usr/bin/unshare --fork --pid --mount-proc /lib/systemd/systemd --system-unit=basic.target

 

exec sudo nsenter -t $(pidof syttemd) -a su - $LOGNAME

 

snap version

 

snap version

 

Run Docker-Compose again using the following command:

sudo systemctl daemon-reload

 

If Ubuntu does not throw any  error. Continue by running the following command:

sudo apt install docker.io

 

To check if the installation is successful run the following command:

sudo docker run hello-world

 

There should be a message "Hello from Docker..." that shows that the installation was successful.

 

Hello from Docker

 

Go to the directory where the docker-compose file was downloaded by running a command like the following example:

cd /mnt/c/users/admin/desktop

 

Pulling the Image and Logging Into the Catalog

To pull the image from the docker-compose.yml file run the following command:

sudo docker-compose pull

 

To start the containers and keep them running in the background execute the following command:

sudo docker-compose up

 

After Ubuntu and Docker-Compose have been installed, log into Raynet One Technology Catalog from the localhost. Use the ports and credentials pointed at in the docker-compose.yml file downloaded to the machine.