Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker failing to load apparmor profile upon ubuntu host boot

I have a container x that fails to start automatically upon host boot.

The last message in the container's log is:

set apparmor profile docker-default: no such file or directory

The same container x runs fine if I manually run "docker start x"

Any ideas on what's wrong with my environment ?

like image 790
ccortezia Avatar asked May 09 '14 18:05

ccortezia


People also ask

How do I enable AppArmor at startup?

ensure AppArmor is not disabled in /etc/default/grub if using Ubuntu kernels, or if using non-Ubuntu kernels, that /etc/default/grub has apparmor=1 security=apparmor. ensuring that the apparmor package is installed. enabling the systemd unit: sudo systemctl enable apparmor && sudo systemctl start apparmor.

Does Ubuntu use AppArmor?

AppArmor is an established technology first seen in Immunix and later integrated into Ubuntu, Novell/SUSE, and Mandriva. Core AppArmor functionality is in the mainline Linux kernel from 2.6.

Where is Docker-default AppArmor profile?

By default, Docker applies the docker-default AppArmor profile to new containers. In Docker 1.13 and later this is profile is created in tmpfs and then loaded into the kernel. On Docker 1.12 and earlier it is located in /etc/apparmor. d/docker/ .

Is AppArmor enabled by default?

AppArmor is installed and loaded by default. It uses profiles of an application to determine what files and permissions the application requires. Some packages will install their own profiles, and additional profiles can be found in the apparmor-profiles package.

Why is AppArmor not working after installing?

Apparently, installing apparmor is not enough, since the problem happens even with apparmor installed. More exactly, the error happens because of the docker daemon being loaded before apparmor set its config as explained here. Should work after that. At least, for me it did.

What is AppArmor in Linux?

AppArmor (“Application Armor”) is a Linux kernel security module that allows the system administrator to restrict programs’ capabilities with per-program profiles. Profiles can allow capabilities like network access, raw socket access, and the permission to read, write, or execute files on matching paths.

Why can't I run Docker on Ubuntu Core snap 5100?

As a note to others who may run into this same issue, the main crux of the issue was that the core snap on the 3001 where docker would run successfully was at a newer core snap version, whereas on the 5100, the core snap was stuck at the same outdated version that shipped with the factory Ubuntu Core image.


2 Answers

I just updated to the latest version of docker (first to 0.11.0 and now to 0.11.0) and I am experiencing the same thing on Linux Mint 15 Olivia. Installing apparmor seems to have fixed the issue:

sudo apt-get install apparmor
like image 97
saden1 Avatar answered Nov 07 '22 21:11

saden1


In case you are using fig... I was having the same issue because a wrong "volumes" entry in my fig.yml:

db:
  image: postgres:9
  volumes: ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d

After changing it to the following code, docker could start the "db" container:

db:
  image: postgres:9
  volumes:
    - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
like image 32
semente Avatar answered Nov 07 '22 21:11

semente