【Docker】CentOS7 上无网络情况下安装

自建虚拟机,但是连接不上网络,只能通过下载rpm包进行安装docker

环境:CentOS 7.3.1611 x64

rpm镜像下载地址用的阿里的
https://mirrors.aliyun.com/docker-ce/linux/centos/7/

在这里能找到想要的docker相关的所有包

我这里只下载了三个包。分别是

docker-ce-selinux-17.03.1.ce-0.1.rc1.el7.centos.noarch.rpm
docker-ce-17.03.1.ce-0.1.rc1.el7.centos.x86_64.rpm
containerd.io-1.2.0-1.0.beta.0.el7.x86_64.rpm

将这三个包按照顺序分别安装即可,顺序的话,安装的时候会提示,如果顺序错了会提示有依赖包

rpm -ivh containerd.io-1.2.0-1.0.beta.0.el7.x86_64.rpm 

rpm -ivh docker-ce-selinux-17.03.1.ce-0.1.rc1.el7.centos.noarch.rpm 

rpm -ivh docker-ce-17.03.1.ce-0.1.rc1.el7.centos.x86_64.rpm 

完成安装后,开启服务,查看是否安装成功

[root@centos7 ~]# ps -aux | grep docker
root       4066  0.1  1.3 558656 27392 ?        Ssl  23:50   0:00 /usr/bin/dockerd
root       4069  0.0  0.4 265248  9676 ?        Ssl  23:50   0:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc
root       4250  0.0  0.0 112648   960 pts/1    R+   23:57   0:00 grep --color=auto docker


[root@centos7 ~]# docker -v
Docker version 17.03.1-ce-rc1, build 3476dbf
[root@centos7 ~]# 

[root@centos7 ~]# docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 17.03.1-ce-rc1
Storage Driver: overlay
 Backing Filesystem: xfs
 Supports d_type: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins: 
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 3.10.0-514.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.938 GiB
Name: centos7
ID: QZZ4:6HWQ:6C33:AROF:2HMO:HQLS:UJPY:RTT4:TZ72:TLYT:4NGH:FFO5
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

至此就安装完成了

你可能感兴趣的:(docker)