#!/usr/bin/env bash

ME=`basename "$0"`
#echo "I am ${ME}"

DIR="/host"
if [ ! -d "${DIR}" ]; then
    echo "Could not find docker engine host's filesystem at expected location: ${DIR}"
    exit 1
fi

#echo chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" ${ME} "${@:1}"
exec chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" ${ME} "${@:1}"

#!/usr/bin/env bash
# This script executes any symlinked binary under a "/host" chroot

set +x

ME=$(basename "$0")

DIR="/host"
if [ ! -d "${DIR}" ]; then
    echo "Could not find docker engine host's filesystem at expected location: ${DIR}"
    exit 1
fi

exec chroot /host /usr/bin/env -i PATH="/sbin:/bin:/usr/bin" "${ME}" "${@:1}"

Refactor chroot host wrapper bash script.
Refactor chroot host wrapper bash script.

Cleaned up chroot-host-wrapper.sh and added "set +x" so all commands are
output to stdout before they execute. This should remove the need for
debug print statements.
