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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈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;的核心组件。它们之间的绑定…