docker的卸载
1. 先停止docker服务
2. 删除docker的安装包
- 先查找docker的安装包
- 然后删除上面查找的安装包
- 最后验证下,是不是没有docker的安装包了
3. 删除docker的镜像文件(默认在/var/lib/docker目录下)
执行完以上步骤docker就卸载成功了。
docker安装
本例中安装docker的版本是19.03.09,安装方式是通过离线安装包安装。安装包下载地址
- 解压docker的安装文件
- 将解压的文件复制到/usr/bin/
- 在/etc/systemd/system目录下创建docker.service文件,并给该文件添加执行权限。
文件名为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
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
execstart=/usr/bin/dockerd
execreload=/bin/kill -s hup $mainpid
# having non-zero limit*s causes performance problems due to accounting overhead
# in the kernel. we recommend using cgroups to do container-local accounting.
limitnofile=infinity
limitnproc=infinity
limitcore=infinity
# uncomment tasksmax if your systemd version supports it.
# only systemd 226 and above support this version.
#tasksmax=infinity
timeoutstartsec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
delegate=yes
# kill only the docker process, not all processes in the cgroup
killmode=process
# restart the docker process if it exits prematurely
restart=on-failure
startlimitburst=3
startlimitinterval=60s
[install]
wantedby=multi-user.target
给该文件添加可执行权限。
- 启动docker
- 检查成功与否
发表评论