Launch Docker containers on Linux.

 

Instructions for installing Docker can be found on the manufacturer's site. For Debian / Ubuntu, I did the installation as follows.

Docker Engine vs. Docker Desktop

For Windows and MAC, Docker is available as Docker Desktop. The base for Docker on Windows and MAC provides a Linux virtual machine that allows Docker containers to run. In contrast, Linux with Docker Engine can use its own kernel and run Docker containers without a VM. So for Linux, I would use Docker Engine and not Docker Desktop:

sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) 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-compose-plugin

The current version, see: https://docs.docker.com/engine/install/

Alternative: Ubuntu Server - Server Snaps

When setting up an Ubuntu server (ubuntu.com/download/server), Docker can be selected directly during installation:

The Docker Container Runtime including Docker-compose is installed. 

Note: Snap has different default paths than a normal Docker installation: /var/snap/docker/common/var-lib-docker/. In addition, the Snap version runs in an isolated mode, which means Docker compose files cannot be launched from any folder. 

See also: Install Ubuntu Server

Docker-compose

Docker-compose allows multiple Docker containers to be stored in a common docker-compose.yml file, allowing them to be started or upgraded together. Docker-compose can be added with the following commands:

sudo apt install docker-compose

Run Docker for a specific user without root

To allow the logged in user to execute Docker commands without "root", the user can be authorized as follows:

me@l1:~$ sudo apt install acl
me@l1:~$ sudo setfacl -m user:$USER:rw /var/run/docker.sock

Instructions for the following platforms

For the following platforms, there is a corresponding Docker installation guide on the vendor site:

  • CentOS
  • Debian
  • Fedora
  • Raspberry Pi OS (32-bit)
  • RHEL (s390x)
  • SLES
  • Ubuntu
  • Binaries

Source: https://docs.docker.com/engine/install/

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

Questions / Comments


By continuing to browse the site, you agree to our use of cookies. More Details