Install Docker on Ubuntu 20.04 LTS and Dotnet Spark on DockerΒΆ
Tip
Make sure to have Ubuntu 20.04 installed and turn on Ubuntu-20.04 in Docker Settings -> Resources -> WSL Integration
Use the apt command to install the docker.io package:
Start docker and enable it to start after the system reboot: Run, if error "System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down"If error "Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied"
sudo groupadd docker
sudo usermod -aG docker ${user} // where ${user} is current user "ps"
su -s ${USER} // Log out and log back in
Restart WSL 2 ubuntu from Powershell, if su -s command doesn't work
Optionally give any user administrative privileges to docker:
where SOMEUSERNAME is admin userCheck docker version:
Test Docker
docker run hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
Install Dotnet 3.1 on Ubuntu 20.04 LTS
wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
sudo dpkg --purge packages-microsoft-prod && sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
Install VS Code from other post And finally, Clone sample application from HelloUdf we should be able to run and debug dotnet spark on docker
docker run -d --name dotnet-spark-helloudf --network host -v "$HOME/Projects/HelloUdf/bin/Debug:/dotnet/Debug" 3rdman/dotnet-spark:latest