Intall the Docker

更新软件源:

sudo apt update 
sudo apt upgrade

安装docker依赖:

apt-get install ca-certificates curl gnupg lsb-release

添加GPG密钥:

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

添加docker软件源

sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

安装docker:

apt-get install docker-ce docker-ce-cli containerd.io

添加用户组:

sudo usermod -aG docker $USER

Intall the Docker-compose

下载docker-compose:

sudo curl -L "https://github.com/docker/compose/releases/download/v2.23.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

将可执行权限应用于二进制文件:

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

创建软链:

sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

“但行好事,莫问前程”