docker on ubuntu 16.04 error when killing container

后端 未结 6 675
心在旅途
心在旅途 2020-12-08 02:45

I can\'t kill or stop any docker container. I\'ve allowed non-privileged users to run Docker commands. And docker run hello-world works fine. But I can\'t stop

6条回答
  •  鱼传尺愫
    2020-12-08 02:57

    AppArmor (Application Armor) is a Linux security module that protects an operating system and its applications from security threats. To use it, a system administrator associates an AppArmor security profile with each program. Docker expects to find an AppArmor policy loaded and enforced. Check default profiles with:

    # sudo apparmor_status
    

    To use docker default profile on a container, run:

    $ docker run --rm -it --name test-container --security-opt apparmor=docker-default image-name
    

    You disable it using the commands:

    --security-opt apparmor=unconfined
    

    With the docker run commands.

    To disable apparmor service, use:

    # systemctl stop apparmor && systemctl disable apparmor
    

    For Ubuntu 14. Use:

    # service apparmor stop
    # update-rc.d -f apparmor remove
    

    It’s recommended to set working profiles for Docker apparmor than disabling it, especially for production setups.

    Check this awesome google document on Securing Containers with AppArmor.

    https://cloud.google.com/container-optimized-os/docs/how-to/secure-apparmor

提交回复
热议问题