Skip to content

Instantly share code, notes, and snippets.

@tankala
Created May 23, 2021 11:53
Show Gist options
  • Save tankala/200e9286fde580acdfb38c3f0a737bf2 to your computer and use it in GitHub Desktop.
Save tankala/200e9286fde580acdfb38c3f0a737bf2 to your computer and use it in GitHub Desktop.
AppArmor docker profile corrpuption problem

Due to a file corruption or some reason I started getting below error

AppArmor enabled on system but the docker-default profile could not be loaded: strconv.Atoi: parsing "found": invalid syntax

I followed below steps to fix this problem. Please take backup of AppArmor profiles if you created any before running below commands

sudo rm -rf /etc/apparmor*
sudo apt remove --assume-yes --purge apparmor
sudo apt install apparmor
@xaochuk
Copy link

xaochuk commented Feb 16, 2023

Thank you so much, only this helps me.

@jaquelineabreu
Copy link

Obrigada!!!!

@asc0910
Copy link

asc0910 commented Feb 20, 2023

Thanks it worked for me

@ppanon2022
Copy link

The thing is that the files in /etc/apparmor.d come from more than just the apparmor package. There are profile files from packages like isc-dhcp-client, ntp, rsyslog, snapd, tcpdump, and liblxc-common. So what you're doing is wiping out all the MAC security for dhcp-client, ntp, rsyslog, snapd, etc. and weakening O/S security as a result.

@ppanon2022
Copy link

I think https://docs.docker.com/engine/security/apparmor/ provides some indication of the issues with using apparmor and docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment