跳转到主要内容

手工安装docker

方法一

# 下载rpm安装包
yumdownloader --resolve --downloadonly --downloaddir=/data/yum_download/docker docker-ce-19.03.13 docker-ce-cli-19.03.13 containerd.io

# 下载rpm安装包
wget qq829.cn/uploads/software/k8s/docker/containerd.io-1.6.33-3.1.el7.x86_64.rpm
wget qq829.cn/uploads/software/k8s/docker/docker-ce-19.03.13-3.el7.x86_64.rpm
wget qq829.cn/uploads/software/k8s/docker/docker-ce-cli-19.03.13-3.el7.x86_64.rpm

yum install containerd.io-1.6.33-3.1.el7.x86_64.rpm docker-ce-19.03.13-3.el7.x86_64.rpm docker-ce-cli-19.03.13-3.el7.x86_64.rpm

# 其他可能需要的

wget qq829.cn/uploads/software/k8s/docker/conntrack-tools-1.4.4-7.el7.x86_64.rpm
wget qq829.cn/uploads/software/k8s/docker/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
wget qq829.cn/uploads/software/k8s/docker/libnetfilter_cthelper-1.0.0-11.el7.x86_64.rpm
wget qq829.cn/uploads/software/k8s/docker/libnetfilter_cttimeout-1.0.0-7.el7.x86_64.rpm
wget qq829.cn/uploads/software/k8s/docker/libnetfilter_queue-1.0.2-2.el7_2.x86_64.rpm
wget qq829.cn/uploads/software/k8s/docker/socat-1.7.3.2-2.el7.x86_64.rpm



方法二:暂时不支持k8s


# docker-compose下载
https://github.com/docker/compose/releases/

# 下载源文件
wget qq829.cn/uploads/software/k8s/docker/bin/docker-19.03.9.tgz

# 解压缩
tar -xvzf docker-19.03.9.tgz

# 赋予权限
chown root:root ./**

# 复制文件到/usr/bin目录
cp ./** /us/bin

# 添加docker运行需要的用户组
# 注意,可能添加失败,提示组ID已经存在,可以修改一个组ID,但是一定要有dokcer组
# 注意,这个组的作用是启动docker.socket的,也可以修改docker.socket的SocketGroup=root
# 或者,不指定组id,直接使用groupadd docker 增加一个组
groupadd -g 994 docker


# 下载服务配置文件
curl -o /usr/lib/systemd/system/docker.service qq829.cn/uploads/software/k8s/docker/bin/docker.service

curl -o /usr/lib/systemd/system/docker.socket qq829.cn/uploads/software/k8s/docker/bin/docker.socket

curl -o /usr/lib/systemd/system/containerd.service qq829.cn/uploads/software/k8s/docker/bin/containerd.service

# 写入服务开机启动