ubuntu 安裝 docker 詳細步驟

登錄,ubuntu版本 22.04

wqbboy@192.168.1.2's password:
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-153-generic x86_64)* Documentation:  https://help.ubuntu.com* Management:     https://landscape.canonical.com* Support:        https://ubuntu.com/proSystem information as of Mon Sep  8 01:27:24 PM UTC 2025System load:             1.99Usage of /:              61.3% of 23.16GBMemory usage:            53%Swap usage:              0%Processes:               193Users logged in:         0IPv4 address for enp0s3: 192.168.1.2IPv6 address for enp0s3: 2409:8a4c:7255:f380:a00:27ff:fe63:1f6d* Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8sjust raised the bar for easy, resilient and secure K8s cluster deployment.https://ubuntu.com/engage/secure-kubernetes-at-the-edgeExpanded Security Maintenance for Applications is not enabled.54 updates can be applied immediately.
To see these additional updates run: apt list --upgradableEnable ESM Apps to receive additional future security updates.
See https://ubuntu.com/esm or run: sudo pro statusNew release '24.04.3 LTS' available.
Run 'do-release-upgrade' to upgrade to it.Last login: Mon Sep  8 13:27:24 2025

查看docker


wqbboy@mail:~$ docker --version
Command 'docker' not found, but can be installed with:
sudo snap install docker         # version 28.1.1+1, or
sudo apt  install docker.io      # version 27.5.1-0ubuntu3~22.04.2
sudo apt  install podman-docker  # version 3.4.4+ds1-1ubuntu1.22.04.3
See 'snap info docker' for additional versions.

安裝前提依賴


wqbboy@mail:~$ sudo -i
[sudo] password for wqbboy:
root@mail:~# apt-get update
Hit:1 http://mirrors.aliyun.com/ubuntu jammy InRelease
Get:2 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease [128 kB]
Get:3 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease [127 kB]
Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]
Fetched 384 kB in 5s (76.9 kB/s)
Reading package lists... Done
root@mail:~# apt-get install ca-certificates curl gnupg lsb-release
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
lsb-release is already the newest version (11.1.0ubuntu4).
lsb-release set to manually installed.
ca-certificates is already the newest version (20240203~22.04.1).
ca-certificates set to manually installed.
curl is already the newest version (7.81.0-1ubuntu1.20).
gnupg is already the newest version (2.2.27-3ubuntu2.4).
gnupg set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 53 not upgraded.

安裝GPG證書(aliyun)


root@mail:~# curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | s                     udo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (s                     ee apt-key(8)).
OK

寫入軟件源信息


root@mail:~# add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/dock                     er-ce/linux/ubuntu $(lsb_release -cs) stable"
Repository: 'deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu j                     ammy stable'
Description:
Archive for codename: jammy components: stable
More info: http://mirrors.aliyun.com/docker-ce/linux/ubuntu
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-http_mirrors_aliyun_com_                     docker-ce_linux_ubuntu-jammy.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-http_mirror                     s_aliyun_com_docker-ce_linux_ubuntu-jammy.list
Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:2 http://mirrors.aliyun.com/ubuntu jammy InRelease
Hit:3 http://mirrors.aliyun.com/ubuntu jammy-updates InRelease
Hit:4 http://mirrors.aliyun.com/ubuntu jammy-backports InRelease
Get:5 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy InRelease [48.8 kB]
Get:6 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 Packag                     es [55.2 kB]
Fetched 104 kB in 11s (9,650 B/s)
Reading package lists... Done
W: http://mirrors.aliyun.com/docker-ce/linux/ubuntu/dists/jammy/InRelease: Key i                     s stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATI                     ON section in apt-key(8) for details.

cat 查看證書


root@mail:~# cat /etc/apt/sources.list.d/archive_uri-http_mirrors_aliyun_com_docker-ce_linux_ubuntu-jammy.list
deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy stable
# deb-src [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy stable

安裝docker安裝新版本


root@mail:~# apt-get install docker-ce docker-ce-cli containerd.io
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:docker-buildx-plugin docker-ce-rootless-extras docker-compose-plugin libslirp0 pigz slirp4netns
Suggested packages:cgroupfs-mount | cgroup-lite docker-model-plugin
The following NEW packages will be installed:containerd.io docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extrasdocker-compose-plugin libslirp0 pigz slirp4netns
0 upgraded, 9 newly installed, 0 to remove and 53 not upgraded.
Need to get 103 MB of archives.
After this operation, 431 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 containerd.io amd64 1.7.27-1 [30.5 MB]
Get:2 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 docker-ce-cli amd64 5:28.4.0-1~ubuntu.22.04~jammy [16.5 MB]
Get:3 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 docker-ce amd64 5:28.4.0-1~ubuntu.22.04~jammy [19.7 MB]
Get:4 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 pigz amd64 2.6-1 [63.6 kB]
Get:5 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 docker-buildx-plugin amd64 0.27.0-1~ubuntu.22.04~jammy [15.9 MB]
Get:6 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 docker-ce-rootless-extras amd64 5:28.4.0-1~ubuntu.22.04~jammy [6,479 kB]
Get:7 http://mirrors.aliyun.com/docker-ce/linux/ubuntu jammy/stable amd64 docker-compose-plugin amd64 2.39.2-1~ubuntu.22.04~jammy [14.2 MB]
Get:8 http://mirrors.aliyun.com/ubuntu jammy/main amd64 libslirp0 amd64 4.6.1-1build1 [61.5 kB]
Get:9 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 slirp4netns amd64 1.0.1-2 [28.2 kB]
Fetched 103 MB in 10s (10.3 MB/s)
Selecting previously unselected package containerd.io.
(Reading database ... 90305 files and directories currently installed.)
Preparing to unpack .../0-containerd.io_1.7.27-1_amd64.deb ...
Unpacking containerd.io (1.7.27-1) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../1-docker-ce-cli_5%3a28.4.0-1~ubuntu.22.04~jammy_amd64.deb ...
Unpacking docker-ce-cli (5:28.4.0-1~ubuntu.22.04~jammy) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../2-docker-ce_5%3a28.4.0-1~ubuntu.22.04~jammy_amd64.deb ...
Unpacking docker-ce (5:28.4.0-1~ubuntu.22.04~jammy) ...
Selecting previously unselected package pigz.
Preparing to unpack .../3-pigz_2.6-1_amd64.deb ...
Unpacking pigz (2.6-1) ...
Selecting previously unselected package docker-buildx-plugin.
Preparing to unpack .../4-docker-buildx-plugin_0.27.0-1~ubuntu.22.04~jammy_amd64.deb ...
Unpacking docker-buildx-plugin (0.27.0-1~ubuntu.22.04~jammy) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../5-docker-ce-rootless-extras_5%3a28.4.0-1~ubuntu.22.04~jammy_amd64.deb ...
Unpacking docker-ce-rootless-extras (5:28.4.0-1~ubuntu.22.04~jammy) ...
Selecting previously unselected package docker-compose-plugin.
Preparing to unpack .../6-docker-compose-plugin_2.39.2-1~ubuntu.22.04~jammy_amd64.deb ...
Unpacking docker-compose-plugin (2.39.2-1~ubuntu.22.04~jammy) ...
Selecting previously unselected package libslirp0:amd64.
Preparing to unpack .../7-libslirp0_4.6.1-1build1_amd64.deb ...
Unpacking libslirp0:amd64 (4.6.1-1build1) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../8-slirp4netns_1.0.1-2_amd64.deb ...
Unpacking slirp4netns (1.0.1-2) ...
Setting up docker-buildx-plugin (0.27.0-1~ubuntu.22.04~jammy) ...
Setting up containerd.io (1.7.27-1) ...
Created symlink /etc/systemd/system/multi-user.target.wants/containerd.service → /lib/systemd/system/containerd.service.
Setting up docker-compose-plugin (2.39.2-1~ubuntu.22.04~jammy) ...
Setting up docker-ce-cli (5:28.4.0-1~ubuntu.22.04~jammy) ...
Setting up libslirp0:amd64 (4.6.1-1build1) ...
Setting up pigz (2.6-1) ...
Setting up docker-ce-rootless-extras (5:28.4.0-1~ubuntu.22.04~jammy) ...
Setting up slirp4netns (1.0.1-2) ...
Setting up docker-ce (5:28.4.0-1~ubuntu.22.04~jammy) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for libc-bin (2.35-0ubuntu3.10) ...
Scanning processes...
Scanning linux images...Running kernel seems to be up-to-date.No services need to be restarted.No containers need to be restarted.No user sessions are running outdated binaries.No VM guests are running outdated hypervisor (qemu) binaries on this host.
root@mail:~#

增加用戶組,查看docker狀態

root@mail:~# groupadd docker
groupadd: group 'docker' already exists
root@mail:~# systemctl status docker
● docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Active: active (running) since Mon 2025-09-08 13:32:44 UTC; 7min ago
TriggeredBy: ● docker.socketDocs: https://docs.docker.comMain PID: 4863 (dockerd)Tasks: 10Memory: 22.9MCPU: 679msCGroup: /system.slice/docker.service└─4863 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sockSep 08 13:32:43 mail dockerd[4863]: time="2025-09-08T13:32:43.223417116Z" level=info msg="detected 1>
Sep 08 13:32:43 mail dockerd[4863]: time="2025-09-08T13:32:43.310117771Z" level=info msg="Creating a>
Sep 08 13:32:43 mail dockerd[4863]: time="2025-09-08T13:32:43.933020832Z" level=info msg="Loading co>
Sep 08 13:32:44 mail dockerd[4863]: time="2025-09-08T13:32:44.435076303Z" level=info msg="Loading co>
Sep 08 13:32:44 mail dockerd[4863]: time="2025-09-08T13:32:44.491334552Z" level=info msg="Docker dae>
Sep 08 13:32:44 mail dockerd[4863]: time="2025-09-08T13:32:44.491741783Z" level=info msg="Initializi>
Sep 08 13:32:44 mail dockerd[4863]: time="2025-09-08T13:32:44.552230002Z" level=info msg="Completed >
Sep 08 13:32:44 mail dockerd[4863]: time="2025-09-08T13:32:44.562534686Z" level=info msg="Daemon has>
Sep 08 13:32:44 mail dockerd[4863]: time="2025-09-08T13:32:44.563030422Z" level=info msg="API listen>
Sep 08 13:32:44 mail systemd[1]: Started Docker Application Container Engine.
lines 1-22/22 (END)

查看docker版本

root@mail:~# docker --version
Docker version 28.4.0, build d8eb465
root@mail:~# docker-compose --version
Command 'docker-compose' not found, but can be installed with:
snap install docker          # version 28.1.1+1, or
apt  install docker-compose  # version 1.29.2-1
See 'snap info docker' for additional versions.
root@mail:~# docker --version
Docker version 28.4.0, build d8eb465

docker換源


root@mail:~# vi /etc/docker/daemon.json

安裝docker-compose


root@mail:~# apt-get install docker-compose
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:python3-docker python3-dockerpty python3-docopt python3-dotenv python3-texttablepython3-websocket
Recommended packages:docker.io
The following NEW packages will be installed:docker-compose python3-docker python3-dockerpty python3-docopt python3-dotenv python3-texttablepython3-websocket
0 upgraded, 7 newly installed, 0 to remove and 53 not upgraded.
Need to get 290 kB of archives.
After this operation, 1,545 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 python3-websocket all 1.2.3-1 [34.7 kB]
Get:2 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 python3-docker all 5.0.3-1 [89.3 kB]
Get:3 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 python3-dockerpty all 0.4.1-2 [11.1 kB]
Get:4 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 python3-docopt all 0.6.2-4 [26.9 kB]
Get:5 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 python3-dotenv all 0.19.2-1 [20.5 kB]
Get:6 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 python3-texttable all 1.6.4-1 [11.4 kB]
Get:7 http://mirrors.aliyun.com/ubuntu jammy/universe amd64 docker-compose all 1.29.2-1 [95.8 kB]
Fetched 290 kB in 0s (961 kB/s)
Selecting previously unselected package python3-websocket.
(Reading database ... 90564 files and directories currently installed.)
Preparing to unpack .../0-python3-websocket_1.2.3-1_all.deb ...
Unpacking python3-websocket (1.2.3-1) ...
Selecting previously unselected package python3-docker.
Preparing to unpack .../1-python3-docker_5.0.3-1_all.deb ...
Unpacking python3-docker (5.0.3-1) ...
Selecting previously unselected package python3-dockerpty.
Preparing to unpack .../2-python3-dockerpty_0.4.1-2_all.deb ...
Unpacking python3-dockerpty (0.4.1-2) ...
Selecting previously unselected package python3-docopt.
Preparing to unpack .../3-python3-docopt_0.6.2-4_all.deb ...
Unpacking python3-docopt (0.6.2-4) ...
Selecting previously unselected package python3-dotenv.
Preparing to unpack .../4-python3-dotenv_0.19.2-1_all.deb ...
Unpacking python3-dotenv (0.19.2-1) ...
Selecting previously unselected package python3-texttable.
Preparing to unpack .../5-python3-texttable_1.6.4-1_all.deb ...
Unpacking python3-texttable (1.6.4-1) ...
Selecting previously unselected package docker-compose.
Preparing to unpack .../6-docker-compose_1.29.2-1_all.deb ...
Unpacking docker-compose (1.29.2-1) ...
Setting up python3-dotenv (0.19.2-1) ...
Setting up python3-texttable (1.6.4-1) ...
Setting up python3-docopt (0.6.2-4) ...
Setting up python3-websocket (1.2.3-1) ...
Setting up python3-dockerpty (0.4.1-2) ...
Setting up python3-docker (5.0.3-1) ...
Setting up docker-compose (1.29.2-1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...Running kernel seems to be up-to-date.No services need to be restarted.No containers need to be restarted.No user sessions are running outdated binaries.No VM guests are running outdated hypervisor (qemu) binaries on this host.

安裝必要的一些系統工具


root@mail:~# apt-get -y install apt-transport-https ca-certificates curl software-properties-common
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20240203~22.04.1).
curl is already the newest version (7.81.0-1ubuntu1.20).
software-properties-common is already the newest version (0.99.22.9).
software-properties-common set to manually installed.
The following NEW packages will be installed:apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 53 not upgraded.
Need to get 1,510 B of archives.
After this operation, 170 kB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu jammy-updates/universe amd64 apt-transport-https all 2.4.14 [1,510 B]
Fetched 1,510 B in 0s (16.4 kB/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 90824 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.4.14_all.deb ...
Unpacking apt-transport-https (2.4.14) ...
Setting up apt-transport-https (2.4.14) ...
Scanning processes...
Scanning linux images...Running kernel seems to be up-to-date.No services need to be restarted.No containers need to be restarted.No user sessions are running outdated binaries.No VM guests are running outdated hypervisor (qemu) binaries on this host.

重啟docker,報錯,只能刪除/etc/docker/daemon.json


root@mail:~# service docker restart
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
root@mail:~# docker --version
Docker version 28.4.0, build d8eb465
root@mail:~# docker-compose --version
docker-compose version 1.29.2, build unknown
root@mail:~# vi /etc/docker/daemon.json
root@mail:~# service docker restart
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
root@mail:~# vi /etc/docker/daemon.json
root@mail:~# service docker restart
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
root@mail:~# vi /etc/docker/daemon.json
root@mail:~# service docker restart
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xeu docker.service" for details.
root@mail:~# systemctl status docker.service
× docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Mon 2025-09-08 13:47:59 UTC; 6s ago
TriggeredBy: × docker.socketDocs: https://docs.docker.comProcess: 6895 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (>Main PID: 6895 (code=exited, status=1/FAILURE)CPU: 64msSep 08 13:47:59 mail systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 08 13:47:59 mail systemd[1]: Stopped Docker Application Container Engine.
Sep 08 13:47:59 mail systemd[1]: docker.service: Start request repeated too quickly.
Sep 08 13:47:59 mail systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 08 13:47:59 mail systemd[1]: Failed to start Docker Application Container Engine.root@mail:~# vi /etc/docker/daemon.json
root@mail:~# mv /etc/docker/daemon.json /etc/docker/daemon.jsonbak
root@mail:~# systemctl status docker.service
× docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Mon 2025-09-08 13:47:59 UTC; 1min 9s ago
TriggeredBy: × docker.socketDocs: https://docs.docker.comProcess: 6895 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (>Main PID: 6895 (code=exited, status=1/FAILURE)CPU: 64msSep 08 13:47:59 mail systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 08 13:47:59 mail systemd[1]: Stopped Docker Application Container Engine.
Sep 08 13:47:59 mail systemd[1]: docker.service: Start request repeated too quickly.
Sep 08 13:47:59 mail systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 08 13:47:59 mail systemd[1]: Failed to start Docker Application Container Engine.
...skipping...
× docker.service - Docker Application Container EngineLoaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)Active: failed (Result: exit-code) since Mon 2025-09-08 13:47:59 UTC; 1min 9s ago
TriggeredBy: × docker.socketDocs: https://docs.docker.comProcess: 6895 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (>Main PID: 6895 (code=exited, status=1/FAILURE)CPU: 64msSep 08 13:47:59 mail systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Sep 08 13:47:59 mail systemd[1]: Stopped Docker Application Container Engine.
Sep 08 13:47:59 mail systemd[1]: docker.service: Start request repeated too quickly.
Sep 08 13:47:59 mail systemd[1]: docker.service: Failed with result 'exit-code'.
Sep 08 13:47:59 mail systemd[1]: Failed to start Docker Application Container Engine.
~

重啟


root@mail:~# service docker restart
root@mail:~# docker-compose --version
docker-compose version 1.29.2, build unknown
root@mail:~#

配置daemon.json

root@mail:~# vi /etc/docker/daemon.jsonroot@mail:~# cat /etc/docker/daemon.json{"registry-mirrors": ["http://hub-mirror.c.163.com"]
}root@mail:~# service docker restart

解決Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/問題

root@mail:~/snap/lxd# docker image pull library/hello-world
Using default tag: latest
Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

第一步:**通過 dig @114.114.114.114 registry-1.docker.io找到可用IP


root@mail:~/snap/lxd# dig @114.114.114.114 registry-1.docker.io; <<>> DiG 9.18.30-0ubuntu0.22.04.2-Ubuntu <<>> @114.114.114.114 registry-1.docker.io
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 65511
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;registry-1.docker.io.          IN      A;; ANSWER SECTION:
registry-1.docker.io.   131     IN      A       31.13.76.99;; Query time: 28 msec
;; SERVER: 114.114.114.114#53(114.114.114.114) (UDP)
;; WHEN: Mon Sep 08 14:14:18 UTC 2025
;; MSG SIZE  rcvd: 65root@mail:~/snap/lxd#

嘗試修改/etc/hosts強制docker.io相關的域名解析到其它可用IP

root@mail:~/snap/lxd# vi /etc/hosts
root@mail:~/snap/lxd# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 mail.xgpolice.com mail# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters31.13.76.99 registry-1.docker.io

保存之后重試:

root@mail:~/snap/lxd# docker image pull library/hello-world
Using default tag: latest

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/96229.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/96229.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/96229.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

AndroidWorld+mobileRL

1、Android地址 https://github.com/google-research/android_world/tree/main?tabreadme-ov-file#installation 這里有排行榜&#xff0c;提交方式為手工提交到共享表格 https://docs.google.com/spreadsheets/d/1cchzP9dlTZ3WXQTfYNhh3avxoLipqHN75v1Tb86uhHo/edit?gid0#g…

《練手:ipv4地址計算和Telnet 遠程設備管理配置實驗文檔》

實驗一&#xff1a;IPv4 地址網段判斷原理及實例 判斷兩個 IPv4 地址是否處于同一網段&#xff0c;核心依據是&#xff1a;將兩個 IP 地址分別與子網掩碼進行AND 運算后&#xff0c;得到的網絡地址是否相同。若相同&#xff0c;則屬于同一網段&#xff1b;反之則不屬于。 實驗拓…

小程序獲取手機號完整流程 彈出框獲取電話號碼

小程序獲取手機號完整流程 彈出框獲取電話號碼 1?? 前提條件 - 使用微信小程序 - 小程序已注冊并通過審核 - 后端可存儲 session_key2?? 小程序端按鈕 <button type"default" open-type"getPhoneNumber" getphonenumber"decryptPhoneNumber&qu…

Nginx 實戰系列(四)—— Nginx反向代理與負載均衡實戰指南

文章目錄前言一、反向代理1.1 反向代理原理1.2 實驗配置示例二、負載均衡2.1 負載均衡基本原理2.2 常見負載均衡策略2.2.1 輪詢&#xff08;Round Robin&#xff09;&#xff08;最常用&#xff09;2.2.2 最少連接數&#xff08;Least Connections&#xff09;2.2.3 IP 哈希&am…

深度學習(一):人工智能、機器學習與深度學習

人工智能 (AI)&#xff1a;宏大的目標 人工智能是最廣泛、最宏大的概念&#xff0c;它的目標是讓機器能夠模仿人類的智能行為&#xff0c;例如&#xff1a; 推理&#xff1a;像下棋程序一樣&#xff0c;通過邏輯來做決策。規劃&#xff1a;為實現一個目標而制定步驟&#xff0c…

[網絡入侵AI檢測] 純卷積神經網絡(CNN)模型 | CNN處理數據

第5章&#xff1a;純卷積神經網絡&#xff08;CNN&#xff09;模型 歡迎回來 在第1章&#xff1a;分類任務配置&#xff08;二分類 vs. 多分類&#xff09;中&#xff0c;我們學習了如何提出正確的問題&#xff1b; 在第2章&#xff1a;數據加載與預處理中&#xff0c;我們準…

Unity AssetBundle詳解

簡介 AssetBundle&#xff08;簡稱&#xff1a;AB包&#xff09; 是 Unity 提供的一種資源壓縮包&#xff0c;用于在應用運行時動態地加載和卸載資源。它可以將非代碼資源&#xff08;如模型、紋理、預制體、音頻、甚至整個場景&#xff09;打包成一個或多個文件&#xff0c;這…

golang-gin包

文章目錄一、了解gin二、html渲染三、gin中get/post獲取值四、路由分組五、中間件六、文件上傳七、gin中的cookie一、了解gin Gin 是一個用 Golang編寫的 高性能的web 框架, 由于http路由的優化&#xff0c;速度提高了近 40 倍。 Gin的特 點就是封裝優雅、API友好。 特性類別…

基于腳手架微服務的視頻點播系統-界面布局部分(二):用戶界面及系統管理界面布局

基于腳手架微服務的視頻點播系統-界面布局部分:二.首頁及播放界面布局一.用戶界面布局1.1用戶界面布局分析與實現1.2更新用戶圖像按鈕及邏輯1.3修改按鈕及邏輯1.4上傳視頻對話框實現邏輯1.4.1頁面跳轉邏輯處理1.4.2頁面控件響應處理二.系統界面布局2.1系統管理頁框架2.2審核管理…

STL庫——二叉搜索樹

? ? ? ? ? づ?ど &#x1f389; 歡迎點贊支持&#x1f389; 個人主頁&#xff1a;勵志不掉頭發的內向程序員&#xff1b; 專欄主頁&#xff1a;C語言&#xff1b; 文章目錄 前言 一、二叉搜索樹的概念 二、二叉搜索樹的性能分析 三、二叉搜索樹的插入 四、二叉搜索樹的查…

【Linux】線程概念與控制

一. 線程的概念1.什么是線程線程是進程內部的一個執行流&#xff0c;是進程調度的基本單位。它具有輕量的特點&#xff0c;它的創建和銷毀所消耗的資源更少&#xff0c;線程間切換比進程間切換消耗的資源更少&#xff1b;它與進程共享一張虛擬地址空間表&#xff0c;通過進程來…

雙軸傾角傳感器廠家與物聯網角度傳感器應用全解析

本文主要探討雙軸傾角傳感器廠家的核心技術優勢&#xff0c;以及物聯網角度傳感器在智能監測中的創新應用。同時&#xff0c;也詳細介紹了水平監測傳感器廠家的解決方案特點&#xff0c;并分析了專業進口傾角傳感器代理所提供的原廠品質保障與本地化服務支持。以深圳瑞慣科技有…

容器-資源隔離機制

一. 引言&#xff1a; 大家都知道&#xff0c;在一臺機器上&#xff0c;可以運行任意(根據系統資源)個容器實例。且各容器間是相互獨立&#xff0c;不做任何關聯的。那么&#xff0c;docker是通過什么方式來實現容器隔離的呢&#xff1f; 接下來我們了解下。 二. 關于容器隔離…

Agentic RL Survey: 從被動生成到自主決策

Agentic RL Survey: 從被動生成到自主決策 本文將系統解讀《The Landscape of Agentic Reinforcement Learning for LLMs: A Survey》這篇綜述。該綜述首次將智能體強化學習&#xff08;Agentic RL&#xff09;與傳統LLM-RL范式正式區分&#xff0c;通過MDP/POMDP理論框架梳理…

徹底禁用 CentOS 7.9 中 vi/vim 的滴滴聲

在 VMware 虛擬機中安裝的 CentOS 7.9 系統&#xff0c;即使通過修改 /etc/inputrc 禁用了終端鈴聲&#xff08;set bell-style none&#xff09;&#xff0c;vi 或 vim 編輯時仍可能發出滴滴聲。這是因為 vi/vim 有自己獨立的鈴聲控制機制。以下是解決方法&#xff1a;方法 1&…

基于A2A和ADK的內容規劃代理

項目概述 Content Planner Agent 是一個基于 Google Agent Development Kit (ADK) 和 Python A2A SDK 構建的智能內容規劃代理。該代理能夠根據高層次的內容描述&#xff0c;創建詳細的內容大綱。 什么是A2A Protocol A2A Protocol&#xff08;Agent2Agent 協議&#xff09;…

Linux-條件變量

文章目錄條件變量概述條件變量的優缺點條件變量相關函數pthread_cond_init函數pthread_cond_destroy函數pthread_cond_wait函數pthread_cond_signal函數測試生產者和消費者模型條件變量 概述 與互斥鎖不同&#xff0c;條件變量是用來等待而不是用來上鎖的&#xff0c;條件變量…

[硬件電路-166]:Multisim - SPICE與Verilog語言的區別

SPICE與Verilog語言在電子設計領域中扮演不同角色&#xff0c;SPICE是電路仿真語言&#xff0c;用于精確模擬電路行為&#xff1b;Verilog是硬件描述語言&#xff0c;用于描述數字電路的結構和行為。以下是兩者的詳細區別&#xff1a;一、核心定位與用途SPICE&#xff1a;電路仿…

玩轉Docker | 使用Docker部署Umbrel操作系統

玩轉Docker | 使用Docker部署Umbrel操作系統 前言 一、 Umbrel 介紹 Umbrel簡介 Umbrel主要特點 二、系統要求 環境要求 環境檢查 Docker版本檢查 檢查操作系統版本 三、部署Umbrel服務 下載Umbrel鏡像 編輯部署文件 創建容器 檢查容器狀態 檢查服務端口 安全設置 四、訪問Umbr…

Flink Task線程處理模型:Mailbox

Task的線程 和 MailboxProcessor 的綁定executingThread 是 Task 類&#xff08;StreamTask 的父類&#xff09;在構造時創建的物理線程。MailboxProcessor 是 StreamTask 用來處理異步事件和驅動其主要處理邏輯&#xff08;processInput&#xff09;的核心組件。它們之間的綁定…