Running Docker Container
To run Docker Container without Docker Desktop on Windows (Windows 2022 server), perform the following steps:
- Procedure
-
Run the PowerShell console as an administrator.
-
In the PowerShell console, run the following command:
PS> wsl --install
The system is restarted to begin the installation. After a successful Ubuntu installation, the Ubuntu WSL2 console is displayed, where you are prompted to create a username and password.
-
To install the Docker engine in the WSL2 environment, in the Ubuntu console, run the following commands:
$ sudo apt-get update
$ sudo apt-get install ca-certificates curl gnupg
$ sudo install -m 0755 -d /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ sudo chmod a+r /etc/apt/keyrings/docker.gpg$ echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -
To grant the user the permission to use Docker, run the following commands:
$ sudo groupdadd docker
$ sudo usermod -aG docker $USER
$ newgrp docker -
To start the Docker engine, run the following command:
$ sudo service docker start
Perform step 5 every time the WSL2 environment is restarted.
-
To find the WSL2 internal IP in the Ubuntu console, run the following command:
$ ip addr show dev eth0 | grep -oP "(inet\s+)\K\S+"
The IP of the WSL2 is the string before "/" in the console output. Save this IP to be used later.
Note: The WSL2 IP address might change after every system restart. -
After the Docker engine has started, you can follow the installation steps described in the Installing ibi Data Intelligence section.
By default, the Docker services start in WSL2 on the following ports: 6081, 9081, 9501, 9551, 9543, 9800, 9801, 9803, 9807, and 9808.
-
To expose these services outside WSL2, configure the portproxy and firewall of the Windows instance as follows:
-
To enable the portproxy, in the PowerShell console, run this command for each port:
PS> netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=9543 connectaddress=<IP_OF_THE_WSL2> connectport=9543
-
In the PowerShell console, open the ports on the firewall for WSL2 services, and run this command for each required port:
PS> netsh advfirewall firewall add rule name="Open Port 9543" dir=in action=allow protocol=TCP localport=9543
-