Cannot start docker container In docker CE on oracle linux

前端 未结 5 856
天命终不由人
天命终不由人 2021-01-01 23:12

Recently I installed Docker CE on my Oracle Linux.
Unfortunately, when I want to start my first container with:

docker run hello-world

相关标签:
5条回答
  • 2021-01-01 23:46

    I was also facing the same issue while trying to run docker inside lxd (linux container). I tried following flag while creating container.

    security.nesting=true

    Example: lxc launch ubuntu:x docker -c security.nesting=true

    0 讨论(0)
  • 2021-01-01 23:52

    OP, I just ran into this issue. I am not sure what your OL support level is. But to stay supported, you really don't want to use the container-selinux from another distro. What I found as a work around is to set the following:

    sudo semanage permissive -a container_runtime_t

    After setting that to permissive running containers worked as expected.

    0 讨论(0)
  • 2021-01-01 23:56

    I was also facing the same issue, but I have solve the problem by this way. if you are not the root, close the selinux by this command:

    sudo setenforce 0

    then docker run ...

    0 讨论(0)
  • 2021-01-01 23:59

    Another approach to solve this issue is to run docker with privileged: true. Note that this flag, gives docker containers access to everything the host is doing i.e to all the devices, mounts and networks. So use it with caution.

    Another approach is set to set make sure to set "selinux-enabled": trueinside your daemon.json. This will make sure the docker knows that selinux is enabled on your system and uses the correct labels when starting the container. More info

    0 讨论(0)
  • 2021-01-02 00:00

    Per the bug that david-maze linked to, updating container-selinux should fix this for you:

    sudo yum install http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.107-1.el7_6.noarch.rpm
    
    0 讨论(0)
提交回复
热议问题