查看: 36|回覆: 0

[Debian] docker ce on Debian

[複製鏈接]

2

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2010-12-31
發表於 2020-5-17 23:10:00 | 顯示全部樓層 |閲讀模式

Note:

# - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

Docker Engine

# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF

sudo apt update

1. install

$sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

docker source

sudo systemctl daemon-reload

源地址

  • /etc/docker/daemon.json
{
  "registry-mirrors" : [
    "https://registry.docker-cn.com",
    "https://mirror.ccs.tencentyun.com"
  ]
}

每次都要更新China源

2. enable

$ sudo systemctl start docker
$ sudo systemctl status docker

test

$ docker --version
$ sudo docker run hello-world

output info

Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
17eec7bbc9d7: Pull complete
ea52d2000f90: Download complete
Digest: sha256:d4aaab6242e0cace87e2ec17a2ed3d779d18fbfd03042ea58f2995626396a274
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

Docker compose

Install the Docker Compose standalone (Legacy)

1. down

sudo curl -SL https://github.com/docker/compose/releases/download/v5.0.1/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

2. exec

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

ou can also create a symbolic link to /usr/bin or any other directory in your path:

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

test

tdtc@tdtc306:~$ docker-compose --version
Docker Compose version v5.0.1

Reference

  • Install Docker Compose
  • Install using the apt repository
  • docker - ubuntu


来源:https://www.cnblogs.com/xiaobin-hlj80/p/12907648.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部