博客园
虽然痛苦,却依旧要快乐,并相信着未来。

导航

 

Docker| Docker compose

# 添加docker的apt库
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg

# 安装docker的官方key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# 设置仓库
echo \
  "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# 更新apt库,利用apt库安装docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# 测试是否安装好,可省略
sudo docker run hello-world
$ sudo apt-get update
$ sudo apt-get install docker-compose-plugin
#测试安装版本
$ docker compose version
#Docker Compose version vN.N.N
#其中vN.N.N是版本号
posted on 2023-07-05 16:33  砖猿  阅读(60)  评论(0编辑  收藏  举报