centos7.8安装docker环境并定制镜像打包镜像导出镜像全过程

PS C:\\system32> ssh root@192.168.52.130
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:PmJdGgPUsAmcdHnVx98VumD2Wy7eaxOwv22vGbfUPRs.
Please contact your system administrator.
Add correct host key in C:\\Users\\xujy/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\xujy/.ssh/known_hosts:6
ECDSA host key for 192.168.52.130 has changed and you have requested strict checking.
Host key verification failed.
PS C:\\system32> ssh -keygen -R 192.168.52.130
Bad escape character ‘ygen'.
PS C:\\system32> ssh-keygen -R 192.168.52.130
# Host 192.168.52.130 found: line 6
C:\Users\xujy/.ssh/known_hosts updated.
Original contents retained as C:\Users\xujy/.ssh/known_hosts.old
PS C:\\system32> ssh root@192.168.52.130
The authenticity of host ‘192.168.52.130 (192.168.52.130)' can't be established.
ECDSA key fingerprint is SHA256:PmJdGgPUsAmcdHnVx98VumD2Wy7eaxOwv22vGbfUPRs.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type ‘yes', ‘no' or the fingerprint: yes
Warning: Permanently added ‘192.168.52.130' (ECDSA) to the list of known hosts.
root@192.168.52.130's password:
Last login: Tue Jan 23 15:15:34 2024
[root@zhiletu001 ~]# df -l
文件系统 1K-块 已用 可用 已用% 挂载点
devtmpfs 3978020 0 3978020 0% /dev
tmpfs 3995028 12 3995016 1% /dev/shm
tmpfs 3995028 14768 3980260 1% /run
tmpfs 3995028 0 3995028 0% /sys/fs/cgroup
/dev/mapper/centos_zhiletu001-root 2087816192 93230836 1994585356 5% /
/dev/sda1 1038336 189924 848412 19% /boot
tmpfs 799008 24 798984 1% /run/user/1000
tmpfs 799008 0 799008 0% /run/user/0
[root@zhiletu001 ~]# bt stop
bash: bt: 未找到命令…
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# yum list|grep
/var/run/yum.pid 已被锁定,PID 为 4489 的另一个程序正在运行。
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:06之前
状态 :睡眠中,进程ID:4489
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:08之前
状态 :睡眠中,进程ID:4489
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:10之前
状态 :不可中断,进程ID:4489
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:12之前
状态 :睡眠中,进程ID:4489
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:14之前
状态 :运行中,进程ID:4489
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:16之前
状态 :睡眠中,进程ID:4489
Another app is currently holding the yum lock; waiting for it to exit…
另一个应用程序是:PackageKit
内存:157 M RSS (578 MB VSZ)
已启动: Tue Jan 23 15:16:34 2024 – 13:18之前
状态 :睡眠中,进程ID:4489
^C

Exiting on user cancel.

[root@zhiletu001 ~]# kill -9 4489
-bash: kill: (4489) – 没有那个进程
[root@zhiletu001 ~]# killall -9 yum
yum: no process found
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# rm -f /var/run/yum.pid 4489
[root@zhiletu001 ~]# yum -y update
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirror.lzu.edu.cn
* updates: mirror.lzu.edu.cn
gitlab_gitlab-ee/x86_64/signature | 862 B 00:00:00
从 https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey 检索密钥
导入 GPG key 0x51312F3F:

指纹 : f640 3f65 44a3 8863 daa0 b6e0 3f01 618a 5131 2f3f
来自 : https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
从 https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg 检索密钥
gitlab_gitlab-ee/x86_64/signature | 1.0 kB 00:00:01 !!!
gitlab_gitlab-ee-source/signature | 862 B 00:00:00
从 https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey 检索密钥
导入 GPG key 0x51312F3F:

指纹 : f640 3f65 44a3 8863 daa0 b6e0 3f01 618a 5131 2f3f
来自 : https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
从 https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg 检索密钥
gitlab_gitlab-ee-source/signature | 951 B 00:00:01 !!!
gitlab_gitlab-ee/x86_64/primary | 4.4 MB 00:00:05
gitlab_gitlab-ee 943/943
^C

由于用户取消而退出
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# yum list|grep docker
cockpit-docker.x86_64 195.12-1.el7.centos extras
docker.x86_64 2:1.13.1-209.git7d71120.el7.centos
docker-client.x86_64 2:1.13.1-209.git7d71120.el7.centos
docker-client-latest.x86_64 1.13.1-58.git87f2fab.el7.centos
docker-common.x86_64 2:1.13.1-209.git7d71120.el7.centos
docker-distribution.x86_64 2.6.2-2.git48294d9.el7 extras
docker-latest.x86_64 1.13.1-58.git87f2fab.el7.centos
docker-latest-logrotate.x86_64 1.13.1-58.git87f2fab.el7.centos
docker-latest-v1.10-migrator.x86_64 1.13.1-58.git87f2fab.el7.centos
docker-logrotate.x86_64 2:1.13.1-209.git7d71120.el7.centos
docker-lvm-plugin.x86_64 2:1.13.1-209.git7d71120.el7.centos
docker-novolume-plugin.x86_64 2:1.13.1-209.git7d71120.el7.centos
docker-registry.x86_64 0.9.1-7.el7 extras
docker-v1.10-migrator.x86_64 2:1.13.1-209.git7d71120.el7.centos
pcp-pmda-docker.x86_64 4.3.2-13.el7_9 updates
podman-docker.noarch 1.6.4-36.el7_9 extras
python-docker-py.noarch 1:1.10.6-11.el7 extras
python-docker-pycreds.noarch 1:0.3.0-11.el7 extras
[root@zhiletu001 ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# yum-config-manager –help
已加载插件:fastestmirror, langpacks
Usage: yum-config-manager [options] [section …]

Options:
插件选项:

Yum Base Options:
-h, –help 显示此帮助消息并退出
-t, –tolerant 忽略错误
-C, –cacheonly 完全从系统缓存运行,不升级缓存
-c [config file], –config=[config file]
配置文件路径
-R [minutes], –randomwait=[minutes]
命令最长等待时间
-d [debug level], –debuglevel=[debug level]
调试输出级别
–showduplicates 在 list/search 命令下,显示源里重复的条目
-e [error level], –errorlevel=[error level]
错误输出级别
–rpmverbosity=[debug level name]
RPM 调试输出级别
-q, –quiet 静默执行
-v, –verbose 详尽的操作过程
-y, –assumeyes 回答全部问题为是
–assumeno 回答全部问题为否
–version 显示 Yum 版本然后退出
–installroot=[path]
设置安装根目录
–enablerepo=[repo]
启用一个或多个软件源(支持通配符)
–disablerepo=[repo]
禁用一个或多个软件源(支持通配符)
-x [package], –exclude=[package]
采用全名或通配符排除软件包
–disableexcludes=[repo]
禁止从主配置,从源或者从任何位置排除
–disableincludes=[repo]
disable includepkgs for a repo or for everything
–obsoletes 更新时处理软件包取代关系
–noplugins 禁用 Yum 插件
–nogpgcheck 禁用 GPG 签名检查
–disableplugin=[plugin]
禁用指定名称的插件
–enableplugin=[plugin]
启用指定名称的插件
–skip-broken 忽略存在问题的软件包
–color=COLOR 配置是否使用颜色
–releasever=RELEASEVER
在 yum 配置和 repo 文件里设置 $releasever 的值
–downloadonly 仅下载而不更新
–downloaddir=DLDIR
指定一个其他文件夹用于保存软件包
–setopt=SETOPTS 设置任意配置和源选项
–bugfix Include bugfix relevant packages, in updates
–security Include security relevant packages, in updates
–advisory=ADVS, –advisories=ADVS
Include packages needed to fix the given advisory, in
updates
–bzs=BZS Include packages needed to fix the given BZ, in
updates
–cves=CVES Include packages needed to fix the given CVE, in
updates
–sec-severity=SEVS, –secseverity=SEVS
Include security relevant packages matching the
severity, in updates

yum-config-manager options:
–save save the current options (useful with –setopt)
–enable enable the specified repos (automatically saves)
–disable disable the specified repos (automatically saves)
–add-repo=ADDREPO add (and enable) the repo from the specified file or
url
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# yum-utils –help
bash: yum-utils: 未找到命令…
[root@zhiletu001 ~]# yum install -y yum-utils device-mapperpersistent-data lvm2
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirror.lzu.edu.cn
* updates: mirror.lzu.edu.cn
gitlab_gitlab-ee/x86_64/signature | 862 B 00:00:00
gitlab_gitlab-ee/x86_64/signature | 1.0 kB 00:00:00 !!!
gitlab_gitlab-ee-source/signature | 862 B 00:00:00
gitlab_gitlab-ee-source/signature | 951 B 00:00:00 !!!
软件包 yum-utils-1.1.31-54.el7_8.noarch 已安装并且是最新版本
没有可用软件包 device-mapperpersistent-data。
正在解决
–> 正在检查事务
—> 软件包 lvm2.x86_64.7.2.02.186-7.el7 将被 升级
—> 软件包 lvm2.x86_64.7.2.02.187-6.el7_9.5 将被 更新
–> 正在处理 lvm2-libs = 7:2.02.187-6.el7_9.5,它被软件包 7:lvm2-2.02.187-6.el7_9.5.x86_64 需要
–> 正在检查事务
—> 软件包 lvm2-libs.x86_64.7.2.02.186-7.el7 将被 升级
—> 软件包 lvm2-libs.x86_64.7.2.02.187-6.el7_9.5 将被 更新
–> 正在处理 device-mapper-event = 7:1.02.170-6.el7_9.5,它被软件包 7:lvm2-libs-2.02.187-6.el7_9.5.x86_64 需要
–> 正在检查事务
—> 软件包 device-mapper-event.x86_64.7.1.02.164-7.el7 将被 升级
—> 软件包 device-mapper-event.x86_64.7.1.02.170-6.el7_9.5 将被 更新
–> 正在处理 device-mapper-event-libs = 7:1.02.170-6.el7_9.5,它被软件包 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64 需要
–> 正在处理依赖关系 device-mapper = 7:1.02.170-6.el7_9.5,它被软件包 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64 需要
–> 正在检查事务
—> 软件包 device-mapper.x86_64.7.1.02.164-7.el7 将被 升级
–> 正在处理依赖关系 device-mapper = 7:1.02.164-7.el7,它被软件包 7:device-mapper-libs-1.02.164-7.el7.x86_64 需要
—> 软件包 device-mapper.x86_64.7.1.02.170-6.el7_9.5 将被 更新
—> 软件包 device-mapper-event-libs.x86_64.7.1.02.164-7.el7 将被 升级
—> 软件包 device-mapper-event-libs.x86_64.7.1.02.170-6.el7_9.5 将被 更新
–> 正在检查事务
—> 软件包 device-mapper-libs.x86_64.7.1.02.164-7.el7 将被 升级
—> 软件包 device-mapper-libs.x86_64.7.1.02.170-6.el7_9.5 将被 更新
–> 解决依赖关系完成

依赖关系解决

================================================================================================================================================================================== Package 架构 版本 源 大小
==================================================================================================================================================================================正在更新:
lvm2 x86_64 7:2.02.187-6.el7_9.5 updates 1.3 M
为依赖而更新:
device-mapper x86_64 7:1.02.170-6.el7_9.5 updates 297 k
device-mapper-event x86_64 7:1.02.170-6.el7_9.5 updates 192 k
device-mapper-event-libs x86_64 7:1.02.170-6.el7_9.5 updates 192 k
device-mapper-libs x86_64 7:1.02.170-6.el7_9.5 updates 325 k
lvm2-libs x86_64 7:2.02.187-6.el7_9.5 updates 1.1 M

事务概要
==================================================================================================================================================================================升级 1 软件包 (+5 依赖软件包)

总计:3.4 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : 7:device-mapper-libs-1.02.170-6.el7_9.5.x86_64 1/12
正在更新 : 7:device-mapper-1.02.170-6.el7_9.5.x86_64 2/12
正在更新 : 7:device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64 3/12
正在更新 : 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64 4/12
正在更新 : 7:lvm2-libs-2.02.187-6.el7_9.5.x86_64 5/12
正在更新 : 7:lvm2-2.02.187-6.el7_9.5.x86_64 6/12
清理 : 7:lvm2-2.02.186-7.el7.x86_64 7/12
清理 : 7:lvm2-libs-2.02.186-7.el7.x86_64 8/12
清理 : 7:device-mapper-event-1.02.164-7.el7.x86_64 9/12
清理 : 7:device-mapper-event-libs-1.02.164-7.el7.x86_64 10/12
清理 : 7:device-mapper-1.02.164-7.el7.x86_64 11/12
清理 : 7:device-mapper-libs-1.02.164-7.el7.x86_64 12/12
验证中 : 7:device-mapper-event-1.02.170-6.el7_9.5.x86_64 1/12
验证中 : 7:lvm2-libs-2.02.187-6.el7_9.5.x86_64 2/12
验证中 : 7:device-mapper-1.02.170-6.el7_9.5.x86_64 3/12
验证中 : 7:lvm2-2.02.187-6.el7_9.5.x86_64 4/12
验证中 : 7:device-mapper-libs-1.02.170-6.el7_9.5.x86_64 5/12
验证中 : 7:device-mapper-event-libs-1.02.170-6.el7_9.5.x86_64 6/12
验证中 : 7:device-mapper-event-libs-1.02.164-7.el7.x86_64 7/12
验证中 : 7:device-mapper-libs-1.02.164-7.el7.x86_64 8/12
验证中 : 7:lvm2-2.02.186-7.el7.x86_64 9/12
验证中 : 7:device-mapper-1.02.164-7.el7.x86_64 10/12
验证中 : 7:lvm2-libs-2.02.186-7.el7.x86_64 11/12
验证中 : 7:device-mapper-event-1.02.164-7.el7.x86_64 12/12

更新完毕:
lvm2.x86_64 7:2.02.187-6.el7_9.5

作为依赖被升级:
device-mapper.x86_64 7:1.02.170-6.el7_9.5 device-mapper-event.x86_64 7:1.02.170-6.el7_9.5 device-mapper-event-libs.x86_64 7:1.02.170-6.el7_9.5
device-mapper-libs.x86_64 7:1.02.170-6.el7_9.5 lvm2-libs.x86_64 7:2.02.187-6.el7_9.5

完毕!
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# yum install -y device-mapper-persistent-data
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirror.lzu.edu.cn
* updates: mirror.lzu.edu.cn
正在解决依赖关系
–> 正在检查事务
—> 软件包 device-mapper-persistent-data.x86_64.0.0.8.5-2.el7 将被 升级
—> 软件包 device-mapper-persistent-data.x86_64.0.0.8.5-3.el7_9.2 将被 更新
–> 解决依赖关系完成

依赖关系解决

================================================================================================================================================================================== Package 架构 版本 源 大小
==================================================================================================================================================================================正在更新:
device-mapper-persistent-data x86_64 0.8.5-3.el7_9.2 updates 423 k

事务概要
==================================================================================================================================================================================升级 1 软件包

总计:423 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64 1/2
清理 : device-mapper-persistent-data-0.8.5-2.el7.x86_64 2/2
验证中 : device-mapper-persistent-data-0.8.5-3.el7_9.2.x86_64 1/2
验证中 : device-mapper-persistent-data-0.8.5-2.el7.x86_64 2/2

更新完毕:
device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2

完毕!

更新完毕:
device-mapper-persistent-data.x86_64 0:0.8.5-3.el7_9.2

完毕!
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo
已加载插件:fastestmirror, langpacks
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@zhiletu001 ~]# yum install docker-ce
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.163.com
* extras: mirror.lzu.edu.cn
* updates: mirror.lzu.edu.cn
正在解决依赖关系
–> 正在检查事务
—> 软件包 docker-ce.x86_64.3.25.0.0-1.el7 将被 安装
–> 正在处理依赖关系 container-selinux >= 2:2.74,它被软件包 3:docker-ce-25.0.0-1.el7.x86_64 需要
–> 正在处理依赖关系 containerd.io >= 1.6.24,它被软件包 3:docker-ce-25.0.0-1.el7.x86_64 需要
–> 正在处理依赖关系 docker-ce-cli,它被软件包 3:docker-ce-25.0.0-1.el7.x86_64 需要
–> 正在处理依赖关系 docker-ce-rootless-extras,它被软件包 3:docker-ce-25.0.0-1.el7.x86_64 需要
–> 正在检查事务
—> 软件包 container-selinux.noarch.2.2.119.2-1.911c772.el7_8 将被 安装
—> 软件包 containerd.io.x86_64.0.1.6.27-3.1.el7 将被 安装
—> 软件包 docker-ce-cli.x86_64.1.25.0.0-1.el7 将被 安装
–> 正在处理依赖关系 docker-buildx-plugin,它被软件包 1:docker-ce-cli-25.0.0-1.el7.x86_64 需要
–> 正在处理依赖关系 docker-compose-plugin,它被软件包 1:docker-ce-cli-25.0.0-1.el7.x86_64 需要
—> 软件包 docker-ce-rootless-extras.x86_64.0.25.0.0-1.el7 将被 安装
–> 正在处理依赖关系 fuse-overlayfs >= 0.7,它被软件包 docker-ce-rootless-extras-25.0.0-1.el7.x86_64 需要
–> 正在处理依赖关系 slirp4netns >= 0.4,它被软件包 docker-ce-rootless-extras-25.0.0-1.el7.x86_64 需要
–> 正在检查事务
—> 软件包 docker-buildx-plugin.x86_64.0.0.12.1-1.el7 将被 安装
—> 软件包 docker-compose-plugin.x86_64.0.2.24.1-1.el7 将被 安装
—> 软件包 fuse-overlayfs.x86_64.0.0.7.2-6.el7_8 将被 安装
–> 正在处理依赖关系 libfuse3.so.3(FUSE_3.2)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
–> 正在处理依赖关系 libfuse3.so.3(FUSE_3.0)(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
–> 正在处理依赖关系 libfuse3.so.3()(64bit),它被软件包 fuse-overlayfs-0.7.2-6.el7_8.x86_64 需要
—> 软件包 slirp4netns.x86_64.0.0.4.3-4.el7_8 将被 安装
–> 正在检查事务
—> 软件包 fuse3-libs.x86_64.0.3.6.1-4.el7 将被 安装
–> 解决依赖关系完成

依赖关系解决

====================================================================================================================================== Package 架构 版本 源 大小
======================================================================================================================================正在安装:
docker-ce x86_64 3:25.0.0-1.el7 docker-ce-stable 26 M
为依赖而安装:
container-selinux noarch 2:2.119.2-1.911c772.el7_8 extras 40 k
containerd.io x86_64 1.6.27-3.1.el7 docker-ce-stable 35 M
docker-buildx-plugin x86_64 0.12.1-1.el7 docker-ce-stable 13 M
docker-ce-cli x86_64 1:25.0.0-1.el7 docker-ce-stable 14 M
docker-ce-rootless-extras x86_64 25.0.0-1.el7 docker-ce-stable 9.4 M
docker-compose-plugin x86_64 2.24.1-1.el7 docker-ce-stable 13 M
fuse-overlayfs x86_64 0.7.2-6.el7_8 extras 54 k
fuse3-libs x86_64 3.6.1-4.el7 extras 82 k
slirp4netns x86_64 0.4.3-4.el7_8 extras 81 k

事务概要
======================================================================================================================================安装 1 软件包 (+9 依赖软件包)

总下载量:110 M
安装大小:387 M
Is this ok [y/d/N]: y
Downloading packages:
(1/10): container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm | 40 kB 00:00:01
warning: /var/cache/yum/x86_64/7/docker-ce-stable/packages/docker-buildx-plugin-0.12.1-1.el7.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 621e9f35: NOKEY
docker-buildx-plugin-0.12.1-1.el7.x86_64.rpm 的公钥尚未安装
(2/10): docker-buildx-plugin-0.12.1-1.el7.x86_64.rpm | 13 MB 00:00:04
(3/10): containerd.io-1.6.27-3.1.el7.x86_64.rpm | 35 MB 00:00:09
(4/10): docker-ce-25.0.0-1.el7.x86_64.rpm | 26 MB 00:00:05
(5/10): docker-ce-rootless-extras-25.0.0-1.el7.x86_64.rpm | 9.4 MB 00:00:02
(6/10): docker-ce-cli-25.0.0-1.el7.x86_64.rpm | 14 MB 00:00:03
(7/10): fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm | 54 kB 00:00:01
(8/10): docker-compose-plugin-2.24.1-1.el7.x86_64.rpm | 13 MB 00:00:01
(9/10): fuse3-libs-3.6.1-4.el7.x86_64.rpm | 82 kB 00:00:01
(10/10): slirp4netns-0.4.3-4.el7_8.x86_64.rpm | 81 kB 00:00:01
————————————————————————————————————————————–总计 7.0 MB/s | 110 MB 00:00:15
从 https://download.docker.com/linux/centos/gpg 检索密钥
导入 GPG key 0x621E9F35:

指纹 : 060a 61c5 1b55 8a7f 742b 77aa c52f eb6b 621e 9f35
来自 : https://download.docker.com/linux/centos/gpg
是否继续?[y/N]:y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安装 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 1/10
正在安装 : containerd.io-1.6.27-3.1.el7.x86_64 2/10
正在安装 : docker-compose-plugin-2.24.1-1.el7.x86_64 3/10
正在安装 : slirp4netns-0.4.3-4.el7_8.x86_64 4/10
正在安装 : fuse3-libs-3.6.1-4.el7.x86_64 5/10
正在安装 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 6/10
正在安装 : docker-buildx-plugin-0.12.1-1.el7.x86_64 7/10
正在安装 : 1:docker-ce-cli-25.0.0-1.el7.x86_64 8/10
正在安装 : docker-ce-rootless-extras-25.0.0-1.el7.x86_64 9/10
正在安装 : 3:docker-ce-25.0.0-1.el7.x86_64 10/10
验证中 : docker-buildx-plugin-0.12.1-1.el7.x86_64 1/10
验证中 : fuse3-libs-3.6.1-4.el7.x86_64 2/10
验证中 : fuse-overlayfs-0.7.2-6.el7_8.x86_64 3/10
验证中 : 3:docker-ce-25.0.0-1.el7.x86_64 4/10
验证中 : containerd.io-1.6.27-3.1.el7.x86_64 5/10
验证中 : 1:docker-ce-cli-25.0.0-1.el7.x86_64 6/10
验证中 : slirp4netns-0.4.3-4.el7_8.x86_64 7/10
验证中 : 2:container-selinux-2.119.2-1.911c772.el7_8.noarch 8/10
验证中 : docker-compose-plugin-2.24.1-1.el7.x86_64 9/10
验证中 : docker-ce-rootless-extras-25.0.0-1.el7.x86_64 10/10

已安装:
docker-ce.x86_64 3:25.0.0-1.el7

作为依赖被安装:
container-selinux.noarch 2:2.119.2-1.911c772.el7_8 containerd.io.x86_64 0:1.6.27-3.1.el7
docker-buildx-plugin.x86_64 0:0.12.1-1.el7 docker-ce-cli.x86_64 1:25.0.0-1.el7
docker-ce-rootless-extras.x86_64 0:25.0.0-1.el7 docker-compose-plugin.x86_64 0:2.24.1-1.el7
fuse-overlayfs.x86_64 0:0.7.2-6.el7_8 fuse3-libs.x86_64 0:3.6.1-4.el7
slirp4netns.x86_64 0:0.4.3-4.el7_8

完毕!
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# systemctl start docker
[root@zhiletu001 ~]# docker -v
Docker version 25.0.0, build e758fe5
[root@zhiletu001 ~]# systemctl status docker
● docker.service – Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since 二 2024-01-23 15:51:47 CST; 13s ago
Docs: https://docs.docker.com
Main PID: 7462 (dockerd)
Tasks: 10
Memory: 31.1M
CGroup: /system.slice/docker.service
└─7462 /usr/bin/dockerd -H fd:// –containerd=/run/containerd/containerd.sock

1月 23 15:51:47 zhiletu001 systemd[1]: Starting Docker Application Container Engine…
1月 23 15:51:47 zhiletu001 dockerd[7462]: time=”2024-01-23T15:51:47.347238292+08:00″ level=info msg=”Starting up”
1月 23 15:51:47 zhiletu001 dockerd[7462]: time=”2024-01-23T15:51:47.466276468+08:00″ level=info msg=”Loading containers: start.”
1月 23 15:51:47 zhiletu001 dockerd[7462]: time=”2024-01-23T15:51:47.744026907+08:00″ level=info msg=”Loading containers: done.”
1月 23 15:51:47 zhiletu001 dockerd[7462]: time=”2024-01-23T15:51:47.767029297+08:00″ level=info msg=”Docker daemon” commit=…=25.0.0
1月 23 15:51:47 zhiletu001 dockerd[7462]: time=”2024-01-23T15:51:47.767271687+08:00″ level=info msg=”Daemon has completed i…zation”
1月 23 15:51:47 zhiletu001 dockerd[7462]: time=”2024-01-23T15:51:47.833220666+08:00″ level=info msg=”API listen on /run/docker.sock”
1月 23 15:51:47 zhiletu001 systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@zhiletu001 ~]# docker run hello-world
Unable to find image ‘hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:4bd78111b6914a99dbc560e6a20eab57ff6655aea4a80c50b0c5491968cbc2e6
Status: Downloaded newer image for hello-world:latest

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

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the “hello-world” image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

[root@zhiletu001 ~]# docker run -it ubuntu bash
Unable to find image ‘ubuntu:latest' locally
latest: Pulling from library/ubuntu
29202e855b20: Pull complete
Digest: sha256:e6173d4dc55e76b87c4af8db8821b1feae4146dd47341e4d431118c7dd060a74
Status: Downloaded newer image for ubuntu:latest
root@9ac40e9aaad5:/# ll
total 0
drwxr-xr-x. 1 root root 6 Jan 23 07:55 ./
drwxr-xr-x. 1 root root 6 Jan 23 07:55 ../
-rwxr-xr-x. 1 root root 0 Jan 23 07:55 .dockerenv*
lrwxrwxrwx. 1 root root 7 Jan 11 14:03 bin -> usr/bin/
drwxr-xr-x. 2 root root 6 Apr 18 2022 boot/
drwxr-xr-x. 5 root root 360 Jan 23 07:55 dev/
drwxr-xr-x. 1 root root 66 Jan 23 07:55 etc/
drwxr-xr-x. 2 root root 6 Apr 18 2022 home/
lrwxrwxrwx. 1 root root 7 Jan 11 14:03 lib -> usr/lib/
lrwxrwxrwx. 1 root root 9 Jan 11 14:03 lib32 -> usr/lib32/
lrwxrwxrwx. 1 root root 9 Jan 11 14:03 lib64 -> usr/lib64/
lrwxrwxrwx. 1 root root 10 Jan 11 14:03 libx32 -> usr/libx32/
drwxr-xr-x. 2 root root 6 Jan 11 14:03 media/
drwxr-xr-x. 2 root root 6 Jan 11 14:03 mnt/
drwxr-xr-x. 2 root root 6 Jan 11 14:03 opt/
dr-xr-xr-x. 333 root root 0 Jan 23 07:55 proc/
drwx——. 2 root root 37 Jan 11 14:06 root/
drwxr-xr-x. 5 root root 46 Jan 11 14:06 run/
lrwxrwxrwx. 1 root root 8 Jan 11 14:03 sbin -> usr/sbin/
drwxr-xr-x. 2 root root 6 Jan 11 14:03 srv/
dr-xr-xr-x. 13 root root 0 Jan 23 07:07 sys/
drwxrwxrwt. 2 root root 6 Jan 11 14:06 tmp/
drwxr-xr-x. 14 root root 160 Jan 11 14:03 usr/
drwxr-xr-x. 11 root root 139 Jan 11 14:06 var/
root@9ac40e9aaad5:/# free -m
total used free shared buff/cache available
Mem: 7802 3743 144 104 3914 3655
Swap: 8063 0 8063
root@9ac40e9aaad5:/# pwd
/
root@9ac40e9aaad5:/# yum –help
bash: yum: command not found
root@9ac40e9aaad5:/# apt –help
apt 2.4.11 (amd64)
Usage: apt [options] command

apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.

Most used commands:
list – list packages based on package names
search – search in package descriptions
show – show package details
install – install packages
reinstall – reinstall packages
remove – remove packages
autoremove – Remove automatically all unused packages
update – update list of available packages
upgrade – upgrade the system by installing/upgrading packages
full-upgrade – upgrade the system by removing/installing/upgrading packages
edit-sources – edit the source information file
satisfy – satisfy dependency strings

See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
This APT has Super Cow Powers.
root@9ac40e9aaad5:/# exit
exit
[root@zhiletu001 ~]# ll /etc/docker
总用量 0
[root@zhiletu001 ~]# systemctl daemon-reload
[root@zhiletu001 ~]# systemctl restart docker
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# docker search centos
NAME DESCRIPTION STARS OFFICIAL
centos DEPRECATED; The official build of CentOS. 7701 [OK]
kasmweb/centos-7-desktop CentOS 7 desktop for Kasm Workspaces 45
bitnami/centos-base-buildpack Centos base compilation image 0
dokken/centos-7 CentOS 7 image for kitchen-dokken 6
dokken/centos-8 CentOS 8 image for kitchen-dokken 6
spack/centos7 CentOS 7 with Spack preinstalled 1
dokken/centos-6 EOL: CentOS 6 image for kitchen-dokken 0
atlas/centos7-atlasos ATLAS CentOS 7 Software Development OS 2
spack/centos6 CentOS 6 with Spack preinstalled 1
ustclug/centos Official CentOS Image with USTC Mirror 0
dokken/centos-stream-8 5
eclipse/centos_jdk8 CentOS, JDK8, Maven 3, git, curl, nmap, mc, … 5
dokken/centos-stream-9 8
adoptopenjdk/centos7_build_image 1
corpusops/centos-bare https://github.com/corpusops/docker-images/ 0
corpusops/centos centos corpusops baseimage 0
adoptopenjdk/centos6_build_image 0
eclipse/centos_go Centos + Go 0
spack/centos-stream 2
fnndsc/centos-python3 Source for a slim Centos-based Python3 image… 0
eclipse/centos_spring_boot Spring boot ready image based on CentOS 0
openmicroscopy/centos-systemd-ip centos/systemd with iproute, for testing mul… 0
eclipse/centos CentOS based minimal stack with only git and… 1
eclipse/centos_nodejs CentOS based nodejs4 stack 0
eclipse/centos_vertx CentOS + vertx 0
[root@zhiletu001 ~]# docker search nginx
NAME DESCRIPTION STARS OFFICIAL
nginx Official build of Nginx. 19512 [OK]
unit Official build of NGINX Unit: Universal Web … 20 [OK]
nginxinc/nginx-unprivileged Unprivileged NGINX Dockerfiles 140
nginx/nginx-ingress NGINX and NGINX Plus Ingress Controllers fo… 88
nginx/nginx-prometheus-exporter NGINX Prometheus Exporter for NGINX and NGIN… 34
nginxinc/nginx-s3-gateway Authenticating and caching gateway based on … 6
nginx/unit This repository is retired, use the Docker o… 64
nginx/nginx-ingress-operator NGINX Ingress Operator for NGINX and NGINX P… 2
nginxinc/amplify-agent NGINX Amplify Agent docker repository 1
nginx/nginx-quic-qns NGINX QUIC interop 1
nginxinc/ingress-demo Ingress Demo 4
nginxproxy/nginx-proxy Automated nginx proxy for Docker containers … 127
nginxproxy/acme-companion Automated ACME SSL certificate generation fo… 128
bitnami/nginx Bitnami nginx Docker Image 181
bitnami/nginx-ingress-controller Bitnami Docker Image for NGINX Ingress Contr… 32
ubuntu/nginx Nginx, a high-performance reverse proxy & we… 111
nginxinc/nginmesh_proxy_debug 0
nginxproxy/docker-gen Generate files from docker container meta-da… 14
nginxinc/mra-fakes3 0
kasmweb/nginx An Nginx image based off nginx:alpine and in… 7
nginxinc/mra_python_base 0
nginxinc/ngx-rust-tool 0
rancher/nginx-ingress-controller 11
nginxinc/nginmesh_proxy_init 0
[root@zhiletu001 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest e34e831650c1 11 days ago 77.9MB
hello-world latest d2c94e258dcb 8 months ago 13.3kB
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# docker pull nginx
Using default tag: latest

Error response from daemon: Head “https://registry-1.docker.io/v2/library/nginx/manifests/latest”: EOF
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# docker pull nginx
Using default tag: latest
Error response from daemon: Get “https://registry-1.docker.io/v2/library/nginx/manifests/latest”: EOF
[root@zhiletu001 ~]# ping baidu.com
PING baidu.com (39.156.66.10) 56(84) bytes of data.
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=1 ttl=128 time=23.7 ms
64 bytes from 39.156.66.10 (39.156.66.10): icmp_seq=2 ttl=128 time=23.6 ms
^C
— baidu.com ping statistics —
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 23.634/23.707/23.780/0.073 ms
[root@zhiletu001 ~]# docker search nginx
NAME DESCRIPTION STARS OFFICIAL
nginx Official build of Nginx. 19512 [OK]
unit Official build of NGINX Unit: Universal Web … 20 [OK]
nginxinc/nginx-unprivileged Unprivileged NGINX Dockerfiles 140
nginx/nginx-ingress NGINX and NGINX Plus Ingress Controllers fo… 88
nginx/nginx-prometheus-exporter NGINX Prometheus Exporter for NGINX and NGIN… 34
nginxinc/nginx-s3-gateway Authenticating and caching gateway based on … 6
nginx/unit This repository is retired, use the Docker o… 64
nginx/nginx-ingress-operator NGINX Ingress Operator for NGINX and NGINX P… 2
nginxinc/amplify-agent NGINX Amplify Agent docker repository 1
nginx/nginx-quic-qns NGINX QUIC interop 1
nginxinc/ingress-demo Ingress Demo 4
nginxproxy/nginx-proxy Automated nginx proxy for Docker containers … 127
nginxproxy/acme-companion Automated ACME SSL certificate generation fo… 128
bitnami/nginx Bitnami nginx Docker Image 181
bitnami/nginx-ingress-controller Bitnami Docker Image for NGINX Ingress Contr… 32
ubuntu/nginx Nginx, a high-performance reverse proxy & we… 111
nginxinc/nginmesh_proxy_debug 0
nginxproxy/docker-gen Generate files from docker container meta-da… 14
nginxinc/mra-fakes3 0
kasmweb/nginx An Nginx image based off nginx:alpine and in… 7
nginxinc/mra_python_base 0
nginxinc/ngx-rust-tool 0
rancher/nginx-ingress-controller 11
nginxinc/nginmesh_proxy_init 0
[root@zhiletu001 ~]# docker inspect nginx:latest
[]
Error: No such object: nginx:latest
[root@zhiletu001 ~]# docker pull nginx:latest
latest: Pulling from library/nginx
2f44b7a888fa: Pull complete
8b7dd3ed1dc3: Pull complete
35497dd96569: Pull complete
36664b6ce66b: Pull complete
2d455521f76c: Pull complete
dc9c4fdb83d6: Pull complete
8056d2bcf3b6: Pull complete
Digest: sha256:4c0fdaa8b6341bfdeca5f18f7837462c80cff90527ee35ef185571e1c327beac
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
[root@zhiletu001 ~]# docker inspect nginx:latest
[
{
“Id”: “sha256:a8758716bb6aa4d90071160d27028fe4eaee7ce8166221a97d30440c8eac2be6”,
“RepoTags”: [
“nginx:latest”
],
“RepoDigests”: [
“nginx@sha256:4c0fdaa8b6341bfdeca5f18f7837462c80cff90527ee35ef185571e1c327beac”
],
“Parent”: “”,
“Comment”: “buildkit.dockerfile.v0”,
“Created”: “2023-10-24T22:44:45Z”,
“Container”: “”,
“ContainerConfig”: {
“Hostname”: “”,
“Domainname”: “”,
“User”: “”,
“AttachStdin”: false,
“AttachStdout”: false,
“AttachStderr”: false,
“Tty”: false,
“OpenStdin”: false,
“StdinOnce”: false,
“Env”: null,
“Cmd”: null,
“Image”: “”,
“Volumes”: null,
“WorkingDir”: “”,
“Entrypoint”: null,
“OnBuild”: null,
“Labels”: null
},
“DockerVersion”: “”,
“Author”: “”,
“Config”: {
“Hostname”: “”,
“Domainname”: “”,
“User”: “”,
“AttachStdin”: false,
“AttachStdout”: false,
“AttachStderr”: false,
“ExposedPorts”: {
“80/tcp”: {}
},
“Tty”: false,
“OpenStdin”: false,
“StdinOnce”: false,
“Env”: [
“PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”,
“NGINX_VERSION=1.25.3”,
“NJS_VERSION=0.8.2”,
“PKG_RELEASE=1~bookworm”
],
“Cmd”: [
“nginx”,
“-g”,
“daemon off;”
],
“ArgsEscaped”: true,
“Image”: “”,
“Volumes”: null,
“WorkingDir”: “”,
“Entrypoint”: [
“/docker-entrypoint.sh”
],
“OnBuild”: null,
“Labels”: {

},
“StopSignal”: “SIGQUIT”
},
“Architecture”: “amd64”,
“Os”: “linux”,
“Size”: 186728317,
“GraphDriver”: {
“Data”: {
“LowerDir”: “/var/lib/docker/overlay2/e2a9183428dae37944fa32c2d570c0e73c2e790500fda071e6c7f1828bc5a8b8/diff:/var/lib/docker/overlay2/1c6fff3b45f355841516b905ba91f82966b53bfa327ad6e62370be62f2f19c73/diff:/var/lib/docker/overlay2/6caa3ff73e97b0df8033351fccf6829933713ab1c713bea5c354f9c872ad352d/diff:/var/lib/docker/overlay2/b62256de7a21e7fd0d8b533712cdcb1e2c8e9040767d29bcf03131e2676b18f8/diff:/var/lib/docker/overlay2/d79dec7774a89127095091fe7984e6c9a064b416bab487c6968db18129d40bd7/diff:/var/lib/docker/overlay2/888aa2a2a74b878fd6175e74730df6c6f40784c148cefd3148cef789c65d87af/diff”,
“MergedDir”: “/var/lib/docker/overlay2/414f5d46d9ae71b086d07f408a3ed47fbd95a8ff0379ff5a98b57000b27d8f7e/merged”,
“UpperDir”: “/var/lib/docker/overlay2/414f5d46d9ae71b086d07f408a3ed47fbd95a8ff0379ff5a98b57000b27d8f7e/diff”,
“WorkDir”: “/var/lib/docker/overlay2/414f5d46d9ae71b086d07f408a3ed47fbd95a8ff0379ff5a98b57000b27d8f7e/work”
},
“Name”: “overlay2”
},
“RootFS”: {
“Type”: “layers”,
“Layers”: [
“sha256:571ade696b261f0ff46e3cdac4635afc009c4ed3429950cb95cd7e5f70ba0a07”,
“sha256:b6c2a8d6f0ac89ef77e161532f3d9d0dc5dfe0a5f20042e0afc0ad14288405eb”,
“sha256:b61d4b2cd2daf06047984c5876a35338c2beb5ae3f6bef479d25f05772a6a482”,
“sha256:eddcd06e5ef9b91677526f6c55fa01a7d6963c435d5cf2bfb488d91aaa72d4a8”,
“sha256:b4ad478450363f0a8020bb5552641fe6077e78fca48da4d77a979724a3ad2a72”,
“sha256:fbcc9bc44d3e165e7e4f56fb189a05ea5c562a733985ec00d5e3fad309eb63cc”,
“sha256:009507b8560964795eab5126f6363cb2b7403596adf370c9e95d4648c43e771f”
]
},
“Metadata”: {
“LastTagTime”: “0001-01-01T00:00:00Z”
}
}
]
[root@zhiletu001 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest e34e831650c1 11 days ago 77.9MB
nginx latest a8758716bb6a 3 months ago 187MB
hello-world latest d2c94e258dcb 8 months ago 13.3kB
您在 /var/spool/mail/root 中有新邮件
[root@zhiletu001 ~]# docker rmi ubuntu:latest
Error response from daemon: conflict: unable to remove repository reference “ubuntu:latest” (must force) – container 9ac40e9aaad5 is using its referenced image e34e831650c1
[root@zhiletu001 ~]#
[root@zhiletu001 ~]# ll
总用量 8
-rw——-. 1 root root 1984 8月 10 2020 anaconda-ks.cfg
-rw-r–r–. 1 root root 2032 8月 10 2020 initial-setup-ks.cfg
[root@zhiletu001 ~]# pwd
/root
[root@zhiletu001 ~]# mkdir mynginx
[root@zhiletu001 ~]# ll
总用量 8
-rw——-. 1 root root 1984 8月 10 2020 anaconda-ks.cfg
-rw-r–r–. 1 root root 2032 8月 10 2020 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 6 1月 23 16:49 mynginx
[root@zhiletu001 ~]# cd mynginx/
[root@zhiletu001 mynginx]# touch Dockerfile
[root@zhiletu001 mynginx]# ll
总用量 0
-rw-r–r–. 1 root root 0 1月 23 16:49 Dockerfile
[root@zhiletu001 mynginx]# vi Dockerfile
[root@zhiletu001 mynginx]# [root@zhiletu001 mynginx]# docker build -t nginx:v1 .
[+] Building 2.0s (2/2) FINISHED docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.69kB 0.0s
=> ERROR [internal] load metadata for docker.io/library/jdk8u231_centos:V1.0 2.0s
——
> [internal] load metadata for docker.io/library/jdk8u231_centos:V1.0:
——
Dockerfile:1
——————–
1 | >>> FROM jdk8u231_centos:V1.0
2 | #作者信息
3 | MAINTAINER “lixg”
——————–
ERROR: failed to solve: jdk8u231_centos:V1.0: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
[root@zhiletu001 mynginx]# vi Dockerfile
[root@zhiletu001 mynginx]# [root@zhiletu001 mynginx]# docker build -t nginx:v1 .
[+] Building 0.1s (23/24) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.68kB 0.0s
=> [internal] load metadata for docker.io/library/nginx:latest 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [ 1/20] FROM docker.io/library/nginx:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [ 2/20] WORKDIR /usr/local/src/ 0.0s
=> CACHED [ 3/20] RUN yum -y install epel-release 0.0s
=> CACHED [ 4/20] RUN yum makecache fast && yum install epel-release -y 0.0s
=> CACHED [ 5/20] RUN yum install telnet-server -y 0.0s
=> CACHED [ 6/20] RUN yum install telnet.* -y 0.0s
=> CACHED [ 7/20] RUN yum -y install wget 0.0s
=> CACHED [ 8/20] RUN yum -y install patch 0.0s
=> CACHED [ 9/20] RUN yum -y install traceroute 0.0s
=> CACHED [10/20] RUN wget http://nginx.org/download/nginx-1.24.0.tar.gz && tar xzvf nginx-1.24.0.tar.gz 0.0s
=> CACHED [11/20] RUN yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel && yum install -y pcre-devel libxsl 0.0s
=> CACHED [12/20] RUN yum clean all 0.0s
=> CACHED [13/20] RUN useradd -M -s /sbin/nologin nginx 0.0s
=> CACHED [14/20] WORKDIR /usr/local/src/nginx-1.24.0 0.0s
=> ERROR [15/20] ADD nginx_upstream_check_module-master /usr/local/src/nginx_upstream_check_module-master 0.0s

=> CACHED [17/20] RUN ./configure –user=nginx –group=nginx –prefix=/usr/local/nginx –with-file-aio –with-http_ssl_module 0.0s
=> ERROR [18/20] ADD nginx.conf /usr/local/nginx/conf 0.0s
=> ERROR [19/20] ADD index.html /usr/local/nginx/html 0.0s
——
> [15/20] ADD nginx_upstream_check_module-master /usr/local/src/nginx_upstream_check_module-master:
——
——
> [18/20] ADD nginx.conf /usr/local/nginx/conf:
——
——
> [19/20] ADD index.html /usr/local/nginx/html:
——
Dockerfile:38
——————–
36 | ADD nginx.conf /usr/local/nginx/conf
37 | #将本地nginx.conf替换掉镜像里的nginx.conf文件
38 | >>> ADD index.html /usr/local/nginx/html
39 | #设置容器中要挂在到宿主机的目录
40 | VOLUME /usr/local/nginx/html
——————–
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 21c67c07-647a-4b5d-8e9e-224cebd49894::w962jncosuhcgb0kpnbzkakff: “/index.html”: not found
[root@zhiletu001 mynginx]# vi Dockerfile
[root@zhiletu001 mynginx]#
[root@zhiletu001 mynginx]# docker build -t nginx:v1 .
[+] Building 0.1s (23/24) docker:default
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.68kB 0.0s
=> [internal] load metadata for docker.io/library/nginx:latest 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> CACHED [ 1/20] FROM docker.io/library/nginx:latest 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 2B 0.0s
=> [ 2/20] WORKDIR /usr/local/src/ 0.0s
=> CACHED [ 3/20] RUN yum -y install epel-release 0.0s
=> CACHED [ 4/20] RUN yum makecache fast && yum install epel-release -y 0.0s
=> CACHED [ 5/20] RUN yum install telnet-server -y 0.0s
=> CACHED [ 6/20] RUN yum install telnet.* -y 0.0s
=> CACHED [ 7/20] RUN yum -y install wget 0.0s
=> CACHED [ 8/20] RUN yum -y install patch 0.0s
=> CACHED [ 9/20] RUN yum -y install traceroute 0.0s
=> CACHED [10/20] RUN wget http://nginx.org/download/nginx-1.24.0.tar.gz && tar xzvf nginx-1.24.0.tar.gz 0.0s
=> CACHED [11/20] RUN yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel && yum install -y pcre-devel libxsl 0.0s
=> CACHED [12/20] RUN yum clean all 0.0s
=> CACHED [13/20] RUN useradd -M -s /sbin/nologin nginx 0.0s
=> CACHED [14/20] WORKDIR /usr/local/src/nginx-1.24.0 0.0s
=> ERROR [15/20] ADD nginx_upstream_check_module-master /usr/local/src/nginx_upstream_check_module-master 0.0s

=> CACHED [17/20] RUN ./configure –user=nginx –group=nginx –prefix=/usr/local/nginx –with-file-aio –with-http_ssl_module 0.0s
=> ERROR [18/20] ADD nginx.conf /usr/local/nginx/conf 0.0s
=> ERROR [19/20] ADD index.html /usr/local/nginx/html 0.0s
——
> [15/20] ADD nginx_upstream_check_module-master /usr/local/src/nginx_upstream_check_module-master:
——
——
> [18/20] ADD nginx.conf /usr/local/nginx/conf:
——
——
> [19/20] ADD index.html /usr/local/nginx/html:
——
Dockerfile:38
——————–
36 | ADD nginx.conf /usr/local/nginx/conf
37 | #将本地nginx.conf替换掉镜像里的nginx.conf文件
38 | >>> ADD index.html /usr/local/nginx/html
39 | #设置容器中要挂在到宿主机的目录
40 | VOLUME /usr/local/nginx/html
——————–
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 21c67c07-647a-4b5d-8e9e-224cebd49894::1bqa2bq3lcqlpdbwclhk5m1d6: “/index.html”: not found
[root@zhiletu001 mynginx]# ll /usr/local/nginx/html
ls: 无法访问/usr/local/nginx/html: 没有那个文件或目录
[root@zhiletu001 mynginx]#

声明: 除非转自他站(如有侵权,请联系处理)外,本文采用 BY-NC-SA 协议进行授权 | 智乐兔
转载请注明:转自《centos7.8安装docker环境并定制镜像打包镜像导出镜像全过程
本文地址:https://www.zhiletu.com/archives-11309.html
关注公众号:智乐兔

赞赏

wechat pay微信赞赏alipay pay支付宝赞赏

上一篇
下一篇

相关文章

在线留言

你必须 登录后 才能留言!

在线客服
在线客服 X

售前: 点击这里给我发消息
售后: 点击这里给我发消息

智乐兔官微