diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-1.9.1-r2.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-1.9.1-r3.ebuild similarity index 100% rename from sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-1.9.1-r2.ebuild rename to sdk_container/src/third_party/coreos-overlay/app-emulation/docker/docker-1.9.1-r3.ebuild diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/dockerd b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/dockerd index ac33563f8f..4b4f58767f 100644 --- a/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/dockerd +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/docker/files/dockerd @@ -24,6 +24,10 @@ parse_docker_args() { ARG_DRIVER="$1" shift ;; + --selinux-enabled) + ARG_SELINUX="$1" + shift + ;; *) # ignore everything else ;; @@ -55,13 +59,15 @@ select_docker_driver() { esac } -maybe_disable_selinux() { +# Enable selinux except when known to be unsupported (btrfs). +maybe_enable_selinux() { case "${DOCKER_DRIVER}" in btrfs) USE_SELINUX="" ;; *) - # Leave enabled for everything else. + # Enable for everything else. + USE_SELINUX="--selinux-enabled" ;; esac } @@ -75,8 +81,10 @@ if [[ -z "${ARG_DRIVER}" && -z "${DOCKER_DRIVER}" ]]; then select_docker_driver fi -# Enable selinux except when known to be unsupported (btrfs). -USE_SELINUX="--selinux-enabled" -maybe_disable_selinux +USE_SELINUX="" +# Do not override selinux if it is already explicitly configured. +if [[ -z "${ARG_SELINUX}" ]]; then + maybe_enable_selinux +fi exec docker "$@" ${USE_SELINUX}