docker openEuler 安装
下载
根据个人需求选择指定的安装包
https://download.docker.com/linux/static/stable/x86_64/
将安装包放到root根目录下
将文件上传Linux系统并解压
tar -xvf docker-27.3.1.tgz
解压文件移动到指定目录下
cp docker/* /usr/bin/
安装
1、安装Vim
输入rpm -qa|grep vim命令,发现CentOS上只装了vim的最小化安装。
rpm -qa|grep vim
输入yum -y install vim*命令安装vim
yum -y install vim*
vim安装成功后结果如下所示
2、安装docker
将docker注册为service 在/etc/systemd/system目录下创建 docker.service文件
创建文件
vim /etc/systemd/system/docker.service
写入数据
进入后复制数据,然后按【esc】,再输入 【:wq】即可保存退出
[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 --version
设置docker自启动
#检查是否已经开启自启动
systemctl is-enabled docker
#显示 enabled 表示开启 如果是 disabled 则表示没有开启
#设置开启自启动
sudo systemctl enable docker