参考地址:https://docs.docker.com/install/linux/docker-ce/binaries/#install-static-binaries下载静态二进制存档。转到 https://download.docker.com/linux/static/stable/ (或更改stable为nightly或test),选择您的硬件平台,然后下载.tgz与您要安装的Docker Engine-Community版本有关的文件。 本文章下载为:docker-19.03.9.tgz 注意要跟据平台硬件下载以免造成不兼容 将下载好的文件上传到服务器 解压文件 tar xzvf docker-19.03.9.tgz 将二进制文件移到可执行路径上的目录,例如/usr/bin/ cp docker/* /usr/bin/ 配置 docker.service文件 vim /usr/lib/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target

[Service] Type=notify ExecStart=/usr/bin/dockerd ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s

[Install] WantedBy=multi-user.target 启动dockerd服务进程 systemctl daemon-reload systemctl start docker.service 查看docker 安装信息 [root@localhost ~]# docker info Client: Debug Mode: false

Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 19.03.9 Storage Driver: overlay2 Backing Filesystem: xfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd init version: fec3683 Security Options: seccomp Profile: default Kernel Version: 3.10.0-957.el7.x86_64 Operating System: CentOS Linux 7 (Core) OSType: linux Architecture: x86_64 CPUs: 1 Total Memory: 2.761GiB Name: localhost.localdomain ID: IAS3:JCEG:5DP5:UTLT:YYMX:ER2X:YASK:VU2O:ARHF:HPZQ:ICV7:KWJY Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Product License: Community Engine 开机自动启动 systemctl enable docker 由于我们是在无网络状态下安装的docker 容器所以我们也需要下载相关的镜像进行试运行 使用有网服务器下载好镜像 [root@localhost ~]# docker images