This commit is contained in:
rpier1 2020-08-26 04:22:37 +00:00 committed by GitHub
commit de25dcc056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,11 +3,23 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
BUILD_OPTS="$*"
DOCKER="docker"
if ! ${DOCKER} ps >/dev/null 2>&1; then
DOCKER="sudo docker"
SUDO=''
if [ $EUID != 0 ]; then
SUDO='sudo'
fi
function install_binfmt_support {
local binfmtSupport="binfmt-support"
if ! dpkg -s $binfmtSupport &>/dev/null; then
echo "please install $binfmtSupport with this command: $SUDO apt-get install $binfmtSupport"
exit 1
fi
}
install_binfmt_support
DOCKER="$SUDO docker"
if ! ${DOCKER} ps >/dev/null; then
echo "error connecting to docker:"
${DOCKER} ps