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

Viewed 13937

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'

`

2 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.

Related