@wayne.swaniawski
To configure Ubuntu AppArmor for Docker containers, follow these steps:
- Install AppArmor on Ubuntu (if not already installed):
1
2
|
sudo apt-get update
sudo apt-get install apparmor-utils
|
- Add Docker AppArmor profiles:
1
|
sudo curl -o /etc/apparmor.d/docker https://raw.githubusercontent.com/moby/moby/master/contrib/apparmor/docker
|
- Load the Docker AppArmor profile:
1
|
sudo apparmor_parser -r /etc/apparmor.d/docker
|
- Now, you can specify AppArmor profiles in Docker containers. For example, if you want to run a container with the docker-default AppArmor profile, use the following command:
1
|
docker run --security-opt apparmor=docker-default <image-name>
|
Note: You can also create your own AppArmor profiles for Docker containers. For more information, see the Docker documentation on AppArmor profiles.