从二进制文件安装 docker + docker 启动

installed the docker from binaries + docker startup

我们从二进制文件安装 docker 如下(根据 https://docs.docker.com/engine/install/binaries/

wget https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz
--2020-05-06 20:39:22--  https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz
Resolving download.docker.com (download.docker.com)... 13.225.249.16, 13.225.249.45, 13.225.249.106, ...
Connecting to download.docker.com (download.docker.com)|13.225.249.16|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 27816900 (27M) [application/x-tar]
Saving to: ‘docker-17.03.0-ce.tgz’

100%[===================================================================================================================================================>] 27,816,900  4.76MB/s   in 3.7s

2020-05-06 20:39:26 (7.11 MB/s) - ‘docker-17.03.0-ce.tgz’ saved [27816900/27816900]

现在我们tar它

tar xzvf docker-17.03.0-ce.tgz
docker/
docker/docker-containerd-ctr
docker/docker-proxy
docker/docker
docker/docker-containerd
docker/dockerd
docker/docker-init
docker/docker-containerd-shim
docker/docker-runc

解压后的文件tar

# ls
docker  docker-17.03.0-ce.tgz  hsperfdata_root  stable


cd docker/

# ls
docker  docker-containerd  docker-containerd-ctr  docker-containerd-shim  dockerd  docker-init  docker-proxy  docker-runc

现在我们需要 tart dockerd

但是如何tar做到这一点

我们试试

/tmp/docker/dockerd
Failed to connect to containerd. Please make sure containerd is installed in your PATH or you have specified the correct address. Got error: exec: "docker-containerd": executable file not found in $PATH

所以我们哪里错了?

首先你需要从 containerd 下载 运行 containerd, 启动它 containerd& 然后 运行 dockerd &,之后你可以试试 docker run hello-world

不推荐这种方式,最好使用 selinux 或 apparmor 配置文件从存储库安装它。