1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

hack/install.sh: install apparmor when enabled

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
This commit is contained in:
unclejack 2014-09-17 12:13:31 +03:00
parent ca39a3e36b
commit 9619ce9dd1

View file

@ -126,6 +126,18 @@ case "$lsb_dist" in
fi fi
fi fi
# install apparmor utils if they're missing and apparmor is enabled in the kernel
# otherwise Docker will fail to start
if [ "$(cat /sys/module/apparmor/parameters/enabled 2>/dev/null)" = 'Y' ]; then
if command -v apparmor_parser &> /dev/null; then
echo 'apparmor is enabled in the kernel and apparmor utils were already installed'
else
echo 'apparmor is enabled in the kernel, but apparmor_parser missing'
apt_get_update
( set -x; $sh_c 'sleep 3; apt-get install -y -q apparmor' )
fi
fi
if [ ! -e /usr/lib/apt/methods/https ]; then if [ ! -e /usr/lib/apt/methods/https ]; then
apt_get_update apt_get_update
( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https' ) ( set -x; $sh_c 'sleep 3; apt-get install -y -q apt-transport-https' )