Install docker and docker compose

less than 1 minute read

Script để cài đặt docker và docker compose:

Trong đó tags v2.2.1 là version của docker-compose. Khi sử dụng bạn nên sửa lại version tại releases page cho phù hợp với nhu cầu.

Docker no Sudo

To create the docker group and add your user:

  1. Create the docker group.
    sudo groupadd docker
    
  2. Add your user to the docker group.
    sudo usermod -aG docker $USER
    

Configure Docker to start on boot with systemd

Many modern Linux distributions use systemd to manage which services start when the system boots. On Debian and Ubuntu, the Docker service starts on boot by default. To automatically start Docker and containerd on boot for other Linux distributions using systemd, run the following commands:

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

To stop this behavior, use disable instead.

sudo systemctl disable docker.service
sudo systemctl disable containerd.service