麒麟 v10 x86 安装 docker 和 docker-compose

安装 docker

  1. 在 docker 官网查看最新的 docker 版本 https://download.docker.com/linux/static/stable/x86_64/
  2. 下载离线包 wget https://download.docker.com/linux/static/stable/x86_64/docker-20.10.9.tgz
  3. 解压离线包 tar -zxvf docker-20.10.7.tgz
  4. 移动二进制文件 mv docker/* /usr/local/bin/
  5. 测试是否成功 docker version
  6. 编写 service 配置文件
vi /usr/lib/systemd/system/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
ExecStart=/usr/local/bin/dockerd
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
  1. 刷新配置文件,systemctl daemon-reload
  2. 启动 docker service,systemctl restart docker
  3. 设置开机启动 systemctl enable docker

安装 docker-compose

  1. 在 github 查看最新的安装包 https://github.com/docker/compose/releases
  2. 下载安装包 wget https://github.com/docker/compose/releases/download/v2.15.0/docker-compose-linux-x86_64
  3. 移动二进制文件 mv docker-compose-linux-x86_64 /usr/local/bin/docker-compose
  4. 测试是否安装成功 docker-compose version
posted @ 2023-02-26 13:42  To_Ann  阅读(2757)  评论(0编辑  收藏  举报