精华内容
下载资源
问答
  • 一:Docker 安装 Docker 官方网站:https://www.docker.com/ 系统版本选择: Docker 目前已经支持多种操作系统的安装运行,比如 Ubuntu、CentOS、...Docker 版本号之前一直是 0.X 版本或 1.X 版本,但是从 2017 年 3

    一:Docker 安装

    Docker 官方网站:https://www.docker.com/

    系统版本选择:

    Docker 目前已经支持多种操作系统的安装运行,比如 Ubuntu、CentOS、Redhat、Debian、Fedora,甚至是还支持了 Mac 和 Windows;
    在 Linux 系统上需要内核版本在 3.10 及以上;

    ,本次演示的操作系统使用Centos 7.5为例。

    Docker 版本选择:

    Docker 版本号之前一直是 0.X 版本或 1.X 版本,但是从 2017 年 3 月 1 号开始,改为每个季度发布一次稳定版,其版本号规则也统一变更为 YY.MM,例如 17.09 表示是 2017年9月份发布的;

    Github 上的 Docker 项目已更名为 moby(https://github.com/moby/moby);
    Moby 项目属于 Docker 项目的全新上游,Docker 将是一个隶属于 Moby 的子产品,而且之后的版本开始区分为 CE (社区版本)和 EE(企业收费版);
    CE 社区版本和 EE 企业版本都是每个季度发布一个新版本,但是 EE 版本提供后期安全维护 1 年,而 CE 版本则是 4 个月;(官方关于 CE 和 EE 版本维护期的说明:https://blog.docker.com/2017/03/docker-enterprise-edition/

    Docker CE and EE are released quarterly, and CE also has a monthly “Edge” option. Each Docker EE release is supported and maintained for one year and receives security and critical bugfixes during that period. We are also improving Docker CE maintainability by maintaining each quarterly CE release for 4 months. That gets Docker CE users a new 1-month window to update from one version to the next.

    在这里插入图片描述

    1.1:yum 安装

    使用阿里云的 yum 仓库安装 docker-ce:https://developer.aliyun.com/mirror/docker-ce?spm=a2c6h.13651102.0.0.3e221b11u8hBu0

    1.1.1:安装必要的系统工具

    [root@docker ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
    

    1.1.2:添加 yum 源

    添加软件源信息:

    [root@docker ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    

    更新 yum 缓存:

    [root@docker ~]# yum makecache fast
    

    1.1.3:查找 Docker-CE 的版本

    [root@docker ~]# yum list docker-ce.x86_64 --showduplicates | sort -r
     * updates: mirrors.aliyun.com
    Loading mirror speeds from cached hostfile
    Loaded plugins: fastestmirror
     * extras: mirrors.aliyun.com
    docker-ce.x86_64            3:20.10.2-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:20.10.1-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:20.10.0-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.9-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.8-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.7-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.6-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.5-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.4-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.3-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.2-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.14-3.el7                    docker-ce-stable
    docker-ce.x86_64            3:19.03.1-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:19.03.13-3.el7                    docker-ce-stable
    docker-ce.x86_64            3:19.03.12-3.el7                    docker-ce-stable
    docker-ce.x86_64            3:19.03.11-3.el7                    docker-ce-stable
    docker-ce.x86_64            3:19.03.10-3.el7                    docker-ce-stable
    docker-ce.x86_64            3:19.03.0-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.9-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.8-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.7-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.6-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.5-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.4-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.3-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.2-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.1-3.el7                     docker-ce-stable
    docker-ce.x86_64            3:18.09.0-3.el7                     docker-ce-stable
    docker-ce.x86_64            18.06.3.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.06.2.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.06.1.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.06.0.ce-3.el7                    docker-ce-stable
    docker-ce.x86_64            18.03.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            18.03.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.12.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.12.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.09.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.09.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.06.2.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.06.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.06.0.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.03.3.ce-1.el7                    docker-ce-stable
    docker-ce.x86_64            17.03.2.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.03.1.ce-1.el7.centos             docker-ce-stable
    docker-ce.x86_64            17.03.0.ce-1.el7.centos             docker-ce-stable
    

    1.1.4:安装指定版本的 Docker-CE

    默认安装的是最新版本;

    安装 18.09.9-3.el7 版本:

    安装同版本的 docker-ce 和 docker-ce-cli;

    [root@docker ~]# yum -y install docker-ce-18.09.9-3.el7 docker-ce-cli-18.09.9-3.el7
    

    1.1.5:启动 Docker

    [root@docker ~]# systemctl start docker
    [root@docker ~]# systemctl enable docker
    Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
    

    1.1.6:验证安装和启动

    验证 Docker 版本

    [root@docker ~]# docker version
    Client:
     Version:           18.09.9
     API version:       1.39
     Go version:        go1.11.13
     Git commit:        039a7df9ba
     Built:             Wed Sep  4 16:51:21 2019
     OS/Arch:           linux/amd64
     Experimental:      false
    
    Server: Docker Engine - Community
     Engine:
      Version:          18.09.9
      API version:      1.39 (minimum version 1.12)
      Go version:       go1.11.13
      Git commit:       039a7df
      Built:            Wed Sep  4 16:22:32 2019
      OS/Arch:          linux/amd64
      Experimental:     false
    

    查看 docker0 网卡

    [root@docker ~]# ifconfig docker0
    docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
            ether 02:42:c5:a5:96:59  txqueuelen 0  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    查看 Docker 信息

    [root@docker ~]# docker info
    Containers: 0
     Running: 0
     Paused: 0
     Stopped: 0
    Images: 0
    Server Version: 18.09.9
    Storage Driver: devicemapper
     Pool Name: docker-253:0-101254227-pool
     Pool Blocksize: 65.54kB
     Base Device Size: 10.74GB
     Backing Filesystem: xfs
     Udev Sync Supported: true
     Data file: /dev/loop0
     Metadata file: /dev/loop1
     Data loop file: /var/lib/docker/devicemapper/devicemapper/data
     Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
     Data Space Used: 11.8MB
     Data Space Total: 107.4GB
     Data Space Available: 17.17GB
     Metadata Space Used: 581.6kB
     Metadata Space Total: 2.147GB
     Metadata Space Available: 2.147GB
     Thin Pool Minimum Free Space: 10.74GB
     Deferred Removal Enabled: true
     Deferred Deletion Enabled: true
     Deferred Deleted Device Count: 0
     Library Version: 1.02.170-RHEL7 (2020-03-24)
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
     Volume: local
     Network: bridge host macvlan null overlay
     Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
    runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
    init version: fec3683
    Security Options:
     seccomp
      Profile: default
    Kernel Version: 3.10.0-327.el7.x86_64
    Operating System: CentOS Linux 7 (Core)
    OSType: linux
    Architecture: x86_64
    CPUs: 1
    Total Memory: 977.9MiB
    Name: docker
    ID: KO75:J2WN:4UQE:XHFV:VNHA:Q2NC:BGJC:5IRF:L3JO:6FQ2:ELX6:XSKF
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    Labels:
    Experimental: false
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false
    Product License: Community Engine
    
    WARNING: bridge-nf-call-iptables is disabled
    WARNING: bridge-nf-call-ip6tables is disabled
    WARNING: the devicemapper storage-driver is deprecated, and will be removed in a future release.
    WARNING: devicemapper: usage of loopback devices is strongly discouraged for production use.
             Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
    

    1.2:apt 安装

    1.2.1:安装必要的系统工具

    yqc@ubuntu:~$ sudo apt-get update
    yqc@ubuntu:~$ sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
    

    1.2.2:安装 GPG 证书

    yqc@ubuntu:~$ curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
    OK
    

    1.2.3:添加 apt 源

    写入软件源信息:

    yqc@ubuntu:~$ sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
    

    更新 apt:

    yqc@ubuntu:~$ sudo apt-get -y update
    

    1.2.4:查找 Docker-CE 的版本

    yqc@ubuntu:~$ apt-cache madison docker-ce
     docker-ce | 5:20.10.2~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:20.10.1~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:20.10.0~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.14~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.13~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.12~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.11~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.10~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.9~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.8~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.7~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.6~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.5~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.4~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.3~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.2~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.1~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:19.03.0~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.9~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.8~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.7~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.6~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.5~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.4~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.3~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.2~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.1~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 5:18.09.0~3-0~ubuntu-bionic | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 18.06.3~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 18.06.2~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 18.06.1~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 18.06.0~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
     docker-ce | 18.03.1~ce~3-0~ubuntu | https://mirrors.aliyun.com/docker-ce/linux/ubuntu bionic/stable amd64 Packages
    

    1.2.5:安装指定版本的 Docker-CE

    安装 18.09.93-0ubuntu-bionic 版本:

    安装相同版本的 docker-ce 和 docker-ce-cli;

    yqc@ubuntu:~$ sudo apt-get -y install docker-ce=5:18.09.9~3-0~ubuntu-bionic docker-ce-cli=5:18.09.9~3-0~ubuntu-bionic
    

    1.2.6:启动 Docker

    yqc@ubuntu:~$ sudo systemctl start docker
    yqc@ubuntu:~$ sudo systemctl enable docker  
    Synchronizing state of docker.service with SysV service script with /lib/systemd/systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install enable docker
    

    1.2.7:验证安装和启动

    验证 Docker 版本

    yqc@ubuntu:~$ sudo docker version
    Client:
     Version:           18.09.9
     API version:       1.39
     Go version:        go1.11.13
     Git commit:        039a7df9ba
     Built:             Wed Sep  4 16:57:28 2019
     OS/Arch:           linux/amd64
     Experimental:      false
    
    Server: Docker Engine - Community
     Engine:
      Version:          18.09.9
      API version:      1.39 (minimum version 1.12)
      Go version:       go1.11.13
      Git commit:       039a7df
      Built:            Wed Sep  4 16:19:38 2019
      OS/Arch:          linux/amd64
      Experimental:     false
    

    查看 docker0 网卡

    yqc@ubuntu:~$ ifconfig docker0
    docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
            ether 02:42:57:41:d2:da  txqueuelen 0  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    查看 Docker 信息

    yqc@ubuntu:~$ sudo docker info
    Containers: 0
     Running: 0
     Paused: 0
     Stopped: 0
    Images: 0
    Server Version: 18.09.9
    Storage Driver: overlay2
     Backing Filesystem: extfs
     Supports d_type: true
     Native Overlay Diff: true
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
     Volume: local
     Network: bridge host macvlan null overlay
     Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Init Binary: docker-init
    containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
    runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
    init version: fec3683
    Security Options:
     apparmor
     seccomp
      Profile: default
    Kernel Version: 4.15.0-55-generic
    Operating System: Ubuntu 18.04.3 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 1
    Total Memory: 962MiB
    Name: ubuntu
    ID: RH6M:SEJP:FDPY:WMZC:DRJJ:GHMZ:RR3Y:ROC3:VLFN:FPTA:RPOX:4BNQ
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    Labels:
    Experimental: false
    Insecure Registries:
     127.0.0.0/8
    Live Restore Enabled: false
    Product License: Community Engine
    
    WARNING: No swap limit support
    

    解决“不支持 swap 限制” 的警告

    最后有警告信息:WARNING: No swap limit support;

    解决“不支持 swap 限制” 的警告:

    yqc@ubuntu:~$ sudo vim /etc/default/grub
    GRUB_DEFAULT=0
    GRUB_TIMEOUT_STYLE=hidden
    GRUB_TIMEOUT=2
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT=""
    GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 cgroup_enable=memory swapaccount=1"
    
    yqc@ubuntu:~$ sudo update-grub
    Sourcing file `/etc/default/grub'
    Generating grub configuration file ...
    Found linux image: /boot/vmlinuz-4.15.0-55-generic
    Found initrd image: /boot/initrd.img-4.15.0-55-generic
    done
    
    
    

    启动参数中加入 cgroup_enable=memory swapaccount=1

    apt_install_docker.sh

    #!/bin/bash
    # apt install docker.
    sudo apt-get update;
    sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common;
    curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -;
    sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable";
    sudo apt-get -y update;
    sudo apt-get -y install docker-ce=5:18.09.9~3-0~ubuntu-bionic docker-ce-cli=5:18.09.9~3-0~ubuntu-bionic;
    
    展开全文
  • Linux下离线安装Docker最新版本

    万次阅读 多人点赞 2018-09-29 14:48:38
    一、基础环境 ...2、Docker版本:18.06.1 官方下载地址(打不开可能需要科学上网) 3、百度云Docker 18.06.1地址:https://pan.baidu.com/s/1YdN9z72QutPkHBfLq06H1A 密码:dvvh 二、Docker安装 ...

    一、基础环境

    1、操作系统:CentOS 7.3
    2、Docker版本:18.06.1 官方下载地址(打不开可能需要科学上网)
    3、百度云Docker 18.06.1地址:https://pan.baidu.com/s/1YdN9z72QutPkHBfLq06H1A 密码:dvvh
    4、官方参考文档:https://docs.docker.com/install/linux/docker-ce/binaries/#install-static-binaries

    二、Docker安装

    1、解压
    tar -xvf docker-18.06.1-ce.tgz
    
    2、将解压出来的docker文件内容移动到 /usr/bin/ 目录下
    cp docker/* /usr/bin/
    
    3、将docker注册为service
    vim /etc/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
    # 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
    
    4、启动

    添加文件权限并启动docker

    chmod +x /etc/systemd/system/docker.service
    
    systemctl daemon-reload
    systemctl start docker			#启动Docker
    systemctl enable docker.service			#设置开机自启
    
    5、验证
    systemctl status docker			#查看Docker状态
    docker -v			#查看Docker版本
    
    展开全文
  • 安装docker最新版本docker version 20.10.1

    千次阅读 2020-12-17 17:29:02
    安装的shell脚本如下,docker版本docker version 20.10.1 #!/bin/bash yum remove runc -y yum install container-selinux yum-utils ipvsadm -y rpm -ivh ...

    安装的shell脚本如下,docker版本:docker version 20.10.1

    #!/bin/bash
    
    yum remove runc -y
    yum install container-selinux yum-utils ipvsadm -y
    rpm -ivh https://mirrors.aliyun.com/docker-ce/linux/centos/7/x86_64/stable/Packages/containerd.io-1.4.3-3.1.el7.x86_64.rpm    
    yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    yum clean all
    yum makecache
    yum install docker-ce docker-ce-cli -y
     
    mkdir -p /data/docker /data/kubelet  /etc/docker /data/kubelet/plugins/nasplugin.csi.alibabacloud.com
    touch  /etc/docker/daemon.json
     
    cat > /etc/docker/daemon.json <<EOF
    {
        "data-root": "/data/docker",
        "registry-mirrors": [
            "https://6mrynkvw.mirror.aliyuncs.com"
        ],
        "exec-opts": ["native.cgroupdriver=systemd"],
        "log-driver": "json-file",
        "log-opts": {
            "max-size": "100m"
        },
        "storage-driver": "overlay2",
        "storage-opts": [
            "overlay2.override_kernel_check=true"
                ]
        }
    EOF
    systemctl enable docker && systemctl start docker
    
    展开全文
  • 今天在学习 Docker 时,在启动docker环境下的centos时出现 kernel too old 错误。大概意思就是内核版本太低。百度了一圈,尝试了各种解决办法,还是没解决了。但是功夫不负有心人,还是让我找到了,>_<。 属于...

    【原因】:系统内核版本过低。


    【解决】:

    yum update nss
    
    注意,可能会失败,建议找个梯子
    rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
    yum --enablerepo=elrepo-kernel -y install kernel-lt
    

    连接失败的话,可以添加dns解析,我自己加了一个Google和阿里云的

    /etc/resolv.conf
    
    nameserver  8.8.8.8
    nameserver 223.5.5.5
    nameserver 223.6.6.6
    
    

    然后修改启动顺序,修改保存之后重启,在就可以正常运行了

    vim /etc/grub.conf
    
    设置 : default=0
    

    展开全文
  • How to make docker use aufs in CentOS... - Server Faulthttps://serverfault.com/questions/650208/how-to-make-docker-use-aufs-in-centos-7bnied/kernel-ml-aufs: Mainline kernel packages, with AUFS support...
  • 检查docker版本的两个命令

    万次阅读 2018-04-01 20:11:16
    检查docker版本的两个命令来自:https://docs.docker.com/get-started/#test-docker-installation[root@oradoc mnt]# docker --version Docker version 17.06.2-ol, build d02b7ab [root@oradoc mnt]# docker info ...
  • Docker

    万次阅读 2020-12-19 16:44:42
    Docker
  • # 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. # ...
  • 正常做法 重装docker 不要命的做法: 后边加上 --ignore-preflight-errors=SystemVerification
  • 离线安装docker版本

    2018-12-03 18:38:27
    准备,下载docker文件 原教程: 作者:咖啡那么浓 ...Docker版本:18.06.1 官方下载地址(打不开可能需要科学上网) 百度云Docker 18.06.1地址:https://pan.baidu.com/s/1YdN9z72QutPkHBfLq06H1A 密...
  • 查看docker版本

    千次阅读 2019-03-11 09:48:00
    [root@localhost ~]# docker --versionDocker version 1.13.1, build 07f3374/1.13.1[root@localhost ~]# [root@localhost ~]# docker infoContainers: 10 Running: 10 Paused: 0 Stopped: 0Images: 6Server Version...
  • Docker 版本及内核兼容性选择

    千次阅读 2020-09-22 11:56:29
    这是本课程的第一部分:Docker 入门,共 3 节,帮助大家进入 ...Docker版本历程 快速迭代期 在第一节,我们已经知道 Docker 是在 2013 年首次亮相,在 2014 年 6 月 9 日发布了 1.0.0 版本;直到 2017 年,Dock...
  • 但是既然所有书上一开始都说了要pull centos(ubuntu)这个基础镜像,那这不光是为了给mac和windows说来听的,就算宿主机已经是centos,docker能用的只是内核和命名空间等等吧,还有一部分不能拿来用,所以这172M的...
  • 搭建mxnet-gpu docker的pyhon remote kernel 起因 最近看mxnet的东西,打算给实验室的机器装一个mxnet的环境,无奈实验室里面机器已经装了tensorflow,运行了好久了,环境比较老。而mxnet可是支持最新的...
  • 1.线上docker的data文件未做重定向,导致根目录撑爆,无奈重启释放内存中数据 2.线上docker容器alc服务器需要维持10万个会话连接 3.nf_conntrack表爆满,随即切换至host,关闭服务器防火期,关闭net.ipv4.ip_forward=0 ...
  • 在CentOS 6.5 x64使用前端启动docker server时发现报了一个警告 WARNING: You are running linux kernel version 2.6.32-431.23.3.el6.x86_64, which might be unstable running docker. Please upgrade your...
  • 内核无法驱动这文件系统,我在其他环境相同的docker版本docker文件驱动是可以,就很奇怪,可以80%确定是文件系统的原因,我又仔细排查这台服务器文件系统和其他发现我在其他环境使用的是etx4....
  • 1.问题出现 使用docker pull centos 下载镜像文件。在使用docker run -it centos 启动失败。 [root@localhost ~]# docker run ...一般用docker pull centos 不添加参数 默认就是最新的版本,因此打算看看是不是版...
  • How to make docker use aufs in CentOS 7? - Server Faulthttps://serverfault.com/questions/650208/how-to-make-docker-use-aufs-in-centos-7 ...bnied/kernel-ml-aufs: Mainline kernel packages, with AUFS su...
  • docker-coreos-build-kernel-module 用于构建 CoreOS 内核模块的 docker 镜像 这是在
  • 可以直接用镜像运行docker run -it klabteam/klab bash ,进入交互式命令行模式也可以启动笔记本使用。 docker run -p 8888:8888 klabteam/klab jupyter notebook --ip 0.0.0.0 --port 8888 。 添加自己的包 base...
  • Install Docker on ...No matter your distribution of choice, you’ll need a 64-bit installation and a kernel at 3.10 or newer. Kernels older than 3.10 do not have the necessary features Docker requi...
  • 近来有时间一直在捣鼓 Docker。因为服务器选择的是 CentOS 版本,所以实验的环境选择的一直是 CentOS。...如果想研究下 docker swarm 和 k8s 建议使用 Centos 7.4 以上的版本。 经本人实验,CentOS7...
  • CentOS8安装docker-CE版本之镜像加速

    千次阅读 2020-04-06 16:43:57
    目录一、CentOS8简介二、Docker概念三、docker-CE版本的安装四、docker配置镜像加速 一、CentOS8简介 1. CentOS8最终于2019年9月24日发布。由于这是一个源自Red Hat Enterprise Linux (RHEL)的Linux发行版,所以...
  • Win10上Docker无法正常启动 出现install WSL2 kernel update的情况 重启时出现: WSL Microsoft .NET Framework 应用程序中发生了未经处理的异常。如果单击“继续”,应用程序将忽略此错误并尝试继续。如果单击...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 22,193
精华内容 8,877
关键字:

dockerkernel版本