当前位置: 代码网 > it编程>开发工具>Docker > docker的安装和卸载

docker的安装和卸载

2024年08月06日 Docker 我要评论
docker卸载与离线安装docker19.03版本

docker的卸载

1. 先停止docker服务

2. 删除docker的安装包

  • 先查找docker的安装包
  • 然后删除上面查找的安装包
  • 最后验证下,是不是没有docker的安装包了

3. 删除docker的镜像文件(默认在/var/lib/docker目录下)

执行完以上步骤docker就卸载成功了。

docker安装

本例中安装docker的版本是19.03.09,安装方式是通过离线安装包安装。安装包下载地址

  1. 解压docker的安装文件
  1. 将解压的文件复制到/usr/bin/
  1. 在/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

给该文件添加可执行权限。

  1. 启动docker
  1. 检查成功与否
(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com