启动docker,并拉取nginx镜像文件
[root@localhost docker]
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
[root@localhost docker]
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost docker]
1.20.2: Pulling from library/nginx
214ca5fb9032: Pull complete
50836501937f: Pull complete
d838e0361e8e: Pull complete
fcc7a415e354: Pull complete
dc73b4533047: Pull complete
e8750203e985: Pull complete
Digest: sha256:38f8c1d9613f3f42e7969c3b1dd5c3277e635d4576713e6453c6193e66270a6d
Status: Downloaded newer image for nginx:1.20.2
docker.io/library/nginx:1.20.2
保存nginx镜像为离线包,离线包在当前目录下
[root@localhost ~]
上传nginx离线镜像包到离线主机
离线主机安装镜像文件,形成nginx镜像
[root@localhost ~]
fd95118eade9: Loading layer [==================================================>] 83.9MB/83.9MB
c2a3d4a53f9a: Loading layer [==================================================>] 61.98MB/61.98MB
a64d597d6b14: Loading layer [==================================================>] 3.072kB/3.072kB
4f49c6d6dd07: Loading layer [==================================================>] 4.096kB/4.096kB
881700cb7ab2: Loading layer [==================================================>] 3.584kB/3.584kB
07ef16952879: Loading layer [==================================================>] 7.168kB/7.168kB
Loaded image: nginx:1.20.2
查看镜像是否存在
[root@localhost ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx 1.20.2 0584b370e957 23 months ago 141MB
其他离线镜像包如上操作即可,适合内网主机使用