ubuntu安装docker
配置apt 源:
提权
student@master:~$ sudo -i
更改apt 源: 附加网址
https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11AwMYKH
root@master:~# cd /etc/apt/
root@master:/etc/apt# ls
apt.conf.d auth.conf.d preferences.d sources.list sources.list.curtin.old sources.list.d trusted.gpg.d
root@master:/etc/apt# cat sources.list
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
更新安装包
root@master:/etc/apt# sudo apt update
Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease
Get:2 http://mirrors.aliyun.com/ubuntu focal-security InRelease [114 kB]
Get:3 http://mirrors.aliyun.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://mirrors.aliyun.com/ubuntu focal-proposed InRelease [267 kB]
Get:5 http://mirrors.aliyun.com/ubuntu focal-backports InRelease [108 kB]
Get:6 http://mirrors.aliyun.com/ubuntu focal-security/universe Sources [158 kB]
Get:7 http://mirrors.aliyun.com/ubuntu focal-security/multiverse Sources [12.2 kB]
Get:8 http://mirrors.aliyun.com/ubuntu focal-security/main Sources [273 kB]
Get:9 http://mirrors.aliyun.com/ubuntu focal-security/restricted Sources [49.0 kB]
Get:10 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 Packages [2041 kB]
Get:11 http://mirrors.aliyun.com/ubuntu focal-security/main Translation-en [332 kB]
Get:12 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 c-n-f Metadata [12.3 kB]
Get:13 http://mirrors.aliyun.com/ubuntu focal-security/restricted amd64 Packages [1556 kB]
Get:14 http://mirrors.aliyun.com/ubuntu focal-security/restricted Translation-en [219 kB]
Get:15 http://mirrors.aliyun.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [624 B]
Get:16 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 Packages [810 kB]
Get:17 http://mirrors.aliyun.com/ubuntu focal-security/universe Translation-en [160 kB]
Get:18 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 c-n-f Metadata [17.2 kB]
Get:19 http://mirrors.aliyun.com/ubuntu focal-security/multiverse amd64 Packages [22.9 kB]
Get:20 http://mirrors.aliyun.com/ubuntu focal-security/multiverse Translation-en [5488 B]
Get:21 http://mirrors.aliyun.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [528 B]
Get:22 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse Sources [22.0 kB]
Get:23 http://mirrors.aliyun.com/ubuntu focal-updates/universe Sources [308 kB]
Get:24 http://mirrors.aliyun.com/ubuntu focal-updates/main Sources [546 kB]
Get:25 http://mirrors.aliyun.com/ubuntu focal-updates/restricted Sources [49.1 kB]
Get:26 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 Packages [2420 kB]
Get:27 http://mirrors.aliyun.com/ubuntu focal-updates/main Translation-en [414 kB]
Get:28 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.3 kB]
Get:29 http://mirrors.aliyun.com/ubuntu focal-updates/restricted amd64 Packages [1662 kB]
Get:30 http://mirrors.aliyun.com/ubuntu focal-updates/restricted Translation-en [234 kB]
Get:31 http://mirrors.aliyun.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [620 B]
Get:32 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 Packages [1036 kB]
Get:33 http://mirrors.aliyun.com/ubuntu focal-updates/universe Translation-en [242 kB]
Get:34 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [23.8 kB]
Get:35 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse amd64 Packages [25.1 kB]
Get:36 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse Translation-en [7408 B]
Get:37 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [592 B]
Get:38 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted Sources [16.0 kB]
Get:39 http://mirrors.aliyun.com/ubuntu focal-proposed/universe Sources [17.7 kB]
Get:40 http://mirrors.aliyun.com/ubuntu focal-proposed/main Sources [58.0 kB]
Get:41 http://mirrors.aliyun.com/ubuntu focal-proposed/main amd64 Packages [233 kB]
Get:42 http://mirrors.aliyun.com/ubuntu focal-proposed/main Translation-en [52.3 kB]
Get:43 http://mirrors.aliyun.com/ubuntu focal-proposed/main amd64 c-n-f Metadata [2184 B]
Get:44 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted amd64 Packages [240 kB]
Get:45 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted Translation-en [34.0 kB]
Get:46 http://mirrors.aliyun.com/ubuntu focal-proposed/universe amd64 Packages [76.9 kB]
Get:47 http://mirrors.aliyun.com/ubuntu focal-proposed/universe Translation-en [30.7 kB]
Get:48 http://mirrors.aliyun.com/ubuntu focal-proposed/universe amd64 c-n-f Metadata [2412 B]
Get:49 http://mirrors.aliyun.com/ubuntu focal-proposed/multiverse Translation-en [3404 B]
Get:50 http://mirrors.aliyun.com/ubuntu focal-proposed/multiverse amd64 c-n-f Metadata [116 B]
Get:51 http://mirrors.aliyun.com/ubuntu focal-backports/main Sources [9568 B]
Get:52 http://mirrors.aliyun.com/ubuntu focal-backports/universe Sources [10.5 kB]
Get:53 http://mirrors.aliyun.com/ubuntu focal-backports/main amd64 Packages [45.7 kB]
Get:54 http://mirrors.aliyun.com/ubuntu focal-backports/main Translation-en [16.3 kB]
Get:55 http://mirrors.aliyun.com/ubuntu focal-backports/main amd64 c-n-f Metadata [1420 B]
Get:56 http://mirrors.aliyun.com/ubuntu focal-backports/universe amd64 Packages [25.0 kB]
Get:57 http://mirrors.aliyun.com/ubuntu focal-backports/universe Translation-en [16.3 kB]
Get:58 http://mirrors.aliyun.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
Fetched 14.2 MB in 2min 12s (108 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
317 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
查下docker 安装包
root@master:/etc/apt# sudo apt list |grep docker
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
docker-compose/focal 1.25.0-1 all
docker-doc/focal-proposed 20.10.21-0ubuntu1~20.04.1 all
docker-registry/focal-security,focal-updates 2.7.1+ds2-7ubuntu0.2 amd64
docker.io/focal-proposed 20.10.21-0ubuntu1~20.04.1 amd64 [upgradable from: 19.03.8-0ubuntu1.20.04]
docker2aci/focal 0.17.2+dfsg-2 amd64
docker/focal 1.5-2 all
golang-docker-credential-helpers/focal 0.6.3-1 amd64
golang-docker-dev/focal-proposed 20.10.21-0ubuntu1~20.04.1 all
golang-github-appc-docker2aci-dev/focal 0.17.2+dfsg-2 all
golang-github-docker-containerd-dev/focal-security,focal-updates 1.5.2-0ubuntu1~20.04.3 all
golang-github-docker-distribution-dev/focal-security,focal-updates 2.7.1+ds2-7ubuntu0.2 all
golang-github-docker-docker-credential-helpers-dev/focal 0.6.3-1 all
golang-github-docker-docker-dev/focal-proposed 20.10.21-0ubuntu1~20.04.1 all
golang-github-docker-engine-api-dev/focal 0.4.0-4 all
golang-github-docker-go-connections-dev/focal 0.4.0-1 all
golang-github-docker-go-dev/focal 0.0~git20160303.0.d30aec9-3 all
golang-github-docker-go-events-dev/focal 0.0~git20170721.0.9461782-1 all
golang-github-docker-go-metrics-dev/focal 0.0~git20180209.399ea8c-1 all
golang-github-docker-go-units-dev/focal 0.4.0-3 all
golang-github-docker-goamz-dev/focal 0.0~git20160206.0.f0a21f5-3 all
golang-github-docker-leadership-dev/focal 0.1.0-1 all
golang-github-docker-libkv-dev/focal 0.2.1-1 all
golang-github-docker-libtrust-dev/focal 0.0~git20150526.0.9cbd2a1-3 all
golang-github-docker-notary-dev/focal-security,focal-updates 0.6.1~ds2-5ubuntu0.2 all
golang-github-docker-spdystream-dev/focal 0.0~git20181023.6480d4a-1 all
golang-github-fsouza-go-dockerclient-dev/focal-proposed 1.6.0-2ubuntu0.20.04.2 all
golang-github-samalba-dockerclient-dev/focal 0.0~git20160531.0.a303626-2 all
kdocker/focal 5.0-1.1 amd64
libnss-docker/focal 0.02-1 amd64
ovn-docker/focal-updates 20.03.2-0ubuntu0.20.04.4 amd64
python3-docker/focal 4.1.0-1 all
python3-dockerpty/focal 0.4.1-2 all
python3-dockerpycreds/focal 0.3.0-1.1 all
ruby-docker-api/focal 1.22.2-1 all
ruby-kitchen-docker/focal 2.7.0-1 all
vim-syntax-docker/focal-proposed 20.10.21-0ubuntu1~20.04.1 all
wmdocker/focal 1.5-2 amd64
安装docker
root@master:/etc/apt# sudo apt install docker.io
前面有一些初始化操作。。。安装同步时间服务器,开启ip_forward 转发。等等。。