ARM架构服务器安装docker

我的服务器信息为:

在这里插入图片描述

Linux ecs-1bc7-0001 4.19.90-17.5.ky10.aarch64 #1 SMP Fri Aug 7 13:35:33 CST 2020 aarch64 aarch64 aarch64 GNU/Linux

在线方式:
  1. yum update

  2. yum install -y docker-engine

  3. vim /etc/docker/daemon.json 添加如下内容

    {

    “registry-mirrors”:[“https://yw94ds9k.mirror.aliyuncs.com”],

    “data-root”:“/usr/local/bin/docker”,

    “log-driver”:“json-file”,

    “log-opts”: {“max-size”:“100m”, “max-file”:“2”},

    “experimental”: true

    }

  4. sudo systemctl daemon-reload

  5. sudo systemctl start docker.service

  6. sudo systemctl enable docker

离线方式:
  1. 到官网下载docker离线安装包

wget https://download.docker.com/linux/static/stable/aarch64/docker-19.03.9.tgz

  1. 将docker-19.03.9.tgz压缩包上传到服务器中的temp文件夹下

  2. 解压缩:tar -zxvf docker-19.03.9.tgz

  3. 解压的docker文件夹全部移至/usr/bin目录:sudo cp -p docker/* /usr/bin/

  4. 将docker注册为系统服务
    在/usr/lib/systemd/system/目录下,创建docker.service文件:sudo touch /usr/lib/systemd/system/docker.service
    编辑docker.service文件:sudo vim /usr/lib/systemd/system/docker.service
    然后添加如下内容

 [Unit] 

    Description=Docker Application Container Engine 

    Documentation=http://docs.docker.com 

    After=network.target docker.socket 

    [Service] 

    Type=notify 

    EnvironmentFile=-/run/flannel/docker 
    
    WorkingDirectory=/usr/local/bin 

    ExecStart=/usr/bin/dockerd  -H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock --selinux-enabled=false --log-opt max-size=1g 

    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=on-failure 
    
    [Install] 

    WantedBy=multi-user.target
  1. 重载unit配置文件:sudo systemctl daemon-reload

  2. 启动docker:sudo systemctl start docker

  3. 设置开机自启动:sudo systemctl enable docker

  4. 查看状态

    查看docker状态:sudo systemctl status docker

    查看docker系统信息:docker info

    查看docker版本:docker -v

10.安装完的效果
ARM架构服务器安装docker_第1张图片

你可能感兴趣的:(java踩坑,docker,容器,arm,架构,服务器)