Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker: Error response from daemon: AppArmor enabled on system but the docker-default profile could not be loaded

I install docker-ce 19.03.3, on ubuntu 19.04 following the installation procedure described on the official website. The installation worked well. But when I wanted to test by creating a container,

I have this error:

Error response from daemon: AppArmor enabled on system but the docker-default profile could not be loaded

running /usr/sbin/apparmor_parser apparmor_parser -Kr /var/lib/docker/tmp/docker-default911109442

failed with output:

'AppArmor parser error for /var/lib/docker/tmp/docker-default911109442 in /etc/apparmor.d/tunables/global at line 17: Could not open 'tunables/proc'

`

like image 735
william kouwonou Avatar asked Oct 15 '19 11:10

william kouwonou


3 Answers

I installed a new version of Linux Mint 20 Ulyana on a partition of a new drive (with my home directory synced to a different partition), and found Apparmor would not start, and docker would not run with any containers, not even hello_word. The errors all mentioned apparmor. I found that many of the files in

/etc/apparmor.d/

had text to line 7, but showed binary symbols for line 7. I found that the config could be recreated by running:

$ sudo dpkg-reconfigure apparmor

after which the config files in

/etc/apparmor.d/

were all text. Then apparmor would start with

$ /etc/init.d/apparmor restart

Then my docker containers ran again.

like image 79
MagicLAMP Avatar answered Nov 20 '22 05:11

MagicLAMP


You have your answer in this docker issue: https://github.com/moby/moby/issues/20554

You just have to create this file: /etc/apparmor.d/tunables/proc

And put this line inside:

@{PROC}=/proc/
like image 28
Luc Charpentier Avatar answered Nov 20 '22 04:11

Luc Charpentier


Maybe your os is not install apparmor

try to do this apt install apparmor -y

then restart container.

like image 1
lyj Avatar answered Nov 20 '22 06:11

lyj