Files
my-vault/04_Archive/Inbox-Clippings/2024/09/KylinV10-arm64aarch64-Offline-Installationdocke.md
T

3.2 KiB
Raw Blame History

page-title, url, date
page-title url date
麒麟V10arm64/aarch64)离线安装docker Jason's Blog http://www.884358.com/kylinos-docker/ 2024-09-25 13:43:43

跳至正文

下载docker离线包

下载地址:https://download.docker.com/linux/static/stable/
选择系统架构对应的文件目录:aarch64

我目前使用的docker版本是:docker-24.0.7.tgz

安装docker

  1. # 解压 docker 到当前目录

  2. tar -xvf docker-24.0.7.tgz

  3. # 将 docker 文件移动到 /usr/bin 目录下

  4. cp -p docker/* /usr/bin

准备 docker.service系统配置文件

  1. vi docker.service

docker.service文件内容:

  1. docker.service

  2. [Unit]

  3. Description=Docker Application Container Engine

  4. Documentation=https://docs.docker.com

  5. After=network-online.target firewalld.service

  6. Wants=network-online.target

  7. [Service]

  8. Type=notify

  9. # the default is not to use systemd for cgroups because the delegate issues still

  10. # exists and systemd currently does not support the cgroup feature set required

  11. # for containers run by docker

  12. ExecStart=/usr/bin/dockerd

  13. ExecReload=/bin/kill -s HUP $MAINPID

  14. # Having non-zero Limit*s causes performance problems due to accounting overhead

  15. # in the kernel. We recommend using cgroups to do container-local accounting.

  16. LimitNOFILE=infinity

  17. LimitNPROC=infinity

  18. LimitCORE=infinity

  19. # Uncomment TasksMax if your systemd version supports it.

  20. # Only systemd 226 and above support this version.

  21. #TasksMax=infinity

  22. TimeoutStartSec=0

  23. # set delegate yes so that systemd does not reset the cgroups of docker containers

  24. Delegate=yes

  25. # kill only the docker process, not all processes in the cgroup

  26. KillMode=process

  27. # restart the docker process if it exits prematurely

  28. Restart=on-failure

  29. StartLimitBurst=3

  30. StartLimitInterval=60s

  31. [Install]

  32. WantedBy=multi-user.target

将 docker.service 移到 /etc/systemd/system/ 目录

  1. cp docker.service /etc/systemd/system/
  2. # 设置 docker.service 文件权限
  3. chmod +x /etc/systemd/system/docker.service

启动docker

  1. # 重新加载配置文件

  2. systemctl daemon-reload

  3. # 启动docker

  4. systemctl start docker

  5. # 设置 docker 开机自启

  6. systemctl enable docker.service

验证安装是否成功

  1. docker -v

国内加速

参考http://www.884358.com/docker-cmds/#guo_nei_jia_su

安装docker-compose

下载

下载地址:
https://github.com/docker/compose/releases
选择对应系统架构的离线安装包

安装

  1. # 将 docker-compose 文件复制到 /usr/local/bin/ 目录下,并重命名为 docker-compose
  2. cp docker-compose-linux-aarch64 /usr/local/bin/docker-compose
  3. # 设置 docker-compose 文件权限
  4. chmod +x /usr/local/bin/docker-compose

验证

  1. docker-compose -v

参考:https://blog.csdn.net/qq_23845083/article/details/130768859