zoukankan      html  css  js  c++  java
  • CentOS7 docker 安装的 container-selinux 问题及解决

    参考官方文档,

    https://docs.docker.com/engine/install/centos/

    # yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
    # yum install docker-ce docker-ce-cli containerd.io

    ...

    --> Finished Dependency Resolution
    Error: Package: containerd.io-1.2.13-3.2.el7.x86_64 (docker-ce-stable)
               Requires: container-selinux >= 2:2.74
    Error: Package: 3:docker-ce-19.03.12-3.el7.x86_64 (docker-ce-stable)
               Requires: container-selinux >= 2:2.74
    ...

    如下地址,下载 container-selinux 安装包 container-selinux-2.107-3.el7.noarch.rpm

    http://mirror.centos.org/centos/7/extras/x86_64/Packages/  

    # rpm -ivh container-selinux-2.107-3.el7.noarch.rpm 

    重新执行安装命令,

    # yum install docker-ce docker-ce-cli containerd.io

    为了 non-root user 使用方便,

    创建 group, (optional, 安装 docker 时会默认创建)

    $ sudo groupadd docker

    将用户加入 group,

    $ sudo usermod -aG docker $USER

    使 group 改动生效,

    $ newgrp docker 

    设置 docker 随系统启动,

    $ sudo systemctl enable docker
    $ sudo chkconfig docker on

    镜像加速,更改 registry 指向 Aliyun,

    $ sudo mkdir -p /etc/docker

     运行,

    sudo tee /etc/docker/daemon.json <<-'EOF'                        # 从 stdin 得到数据,直到遇到 EOF 为止
    {
      "registry-mirrors": ["https://********.mirror.aliyuncs.com"]   # Aliyun 个人账户下的镜像加速地址
    }
    EOF

    重启服务,

    sudo systemctl daemon-reload
    sudo systemctl restart docker

     (完)

  • 相关阅读:
    poj2942 点-双联通+二分图染色
    poj1523割顶-点双联通
    poj3694 边-双连通分量+lca
    poj3177边-双连通分量
    poj3352 边-双联通分量
    Codeforces Round #377 (Div. 2) F
    Educational Codeforces Round 30D. Merge Sort
    洛谷p3369 treap
    hdu3572线性欧拉筛
    HYSBZ
  • 原文地址:https://www.cnblogs.com/gaowengang/p/13212320.html
Copyright © 2011-2022 走看看