12

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'

`

Ajoe
  • 1,397
  • 4
  • 19
  • 48
william kouwonou
  • 121
  • 1
  • 1
  • 4

5 Answers5

24

Maybe your os is not install apparmor

try to do this apt install apparmor -y

then restart container.

lyj
  • 442
  • 2
  • 5
12

Installing the apparmor-utils package solved it for me

https://docs.docker.com/engine/release-notes/23.0/#known-issues

Filidor Wiese
  • 664
  • 8
  • 16
5

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/
Luc Charpentier
  • 562
  • 5
  • 21
  • This worked for me. I'm using Docker version 19.03.5, build 633a0ea838 on Debian 10. – ak112358 Dec 16 '19 at 03:25
  • 1
    another reason could be an unprivileged LXC container bein used to run docker - needs to be privileged – iDoc Jul 18 '21 at 06:11
5

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.

MagicLAMP
  • 1,032
  • 11
  • 26
3

Running Ubuntu 20.04 LTS, just ran a 'apt update' then 'apt dist-upgrade', got a similar error starting docker. Normally I remove apparmor, as was the case here. I had to re-install apparmor then remove it before docker containers would start.

Dan F
  • 31
  • 4