Docker

Install

Follow Docker Installation Guide via this LINK

Setup

Start docker-client and set automatically start on boot Docker

sudo systemctl start docker && sudo systemctl enable docker

Containerd

sudo systemctl start containerd && sudo systemctl enable containerd

To stop this behavior, use disable instead.

sudo systemctl disable docker
sudo systemctl disable containerd

Run Docker Without Sudo

You can set up the Docker daemon to run without root privileges. This is a good way to avoid using sudo when you use the docker command.

Directly use the following script for a quick setup, or follow the steps below for manual operation.

Quick Setup

WGET

wget -N --no-cache --no-check-certificate https://raw.githubusercontent.com/carry0987/Linux-Script/master/book_source/Docker/docker-setup.sh && chmod +x docker-setup.sh && bash docker-setup.sh

CURL

curl -H 'Cache-Control: no-cache' -O https://raw.githubusercontent.com/carry0987/Linux-Script/master/book_source/Docker/docker-setup.sh && chmod +x docker-setup.sh && bash docker-setup.sh

Manual Setup

  1. Add docker group

    sudo groupadd docker
    
  2. Add current user into docker group

    sudo usermod -aG docker $USER
    
  3. Refresh group list

    newgrp docker
    
  4. Check group

    groups $USER
    
  5. Restart docker service

    sudo systemctl restart docker
    
  6. Test Docker without sudo

    docker info
    

Docker-compose (Optional)

  1. Download the corresponding Linux version of Docker-compose

    sudo curl -L "https://github.com/docker/compose/releases/download/v2.24.6/docker-compose-$(uname -s)-$(uname -m)" \
           -o /usr/local/bin/docker-compose
    
  2. Give execute permission

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

results matching ""

    No results matching ""