feat: Detect Docker Desktop (#242)
This commit is contained in:
parent
72738ce2a3
commit
caa7bc311d
2 changed files with 14 additions and 5 deletions
|
@ -19,6 +19,7 @@ RUN set -eu && \
|
|||
wget \
|
||||
7zip \
|
||||
curl \
|
||||
fdisk \
|
||||
nginx \
|
||||
procps \
|
||||
seabios \
|
||||
|
|
18
src/proc.sh
18
src/proc.sh
|
@ -34,10 +34,10 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||
KVM_ERR=""
|
||||
|
||||
if [ ! -e /dev/kvm ]; then
|
||||
KVM_ERR="(device file missing)"
|
||||
KVM_ERR="(/dev/kvm is missing)"
|
||||
else
|
||||
if ! sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
KVM_ERR="(no write access)"
|
||||
KVM_ERR="(/dev/kvm is unwriteable)"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -45,9 +45,17 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||
KVM="N"
|
||||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||
warn "you are using macOS which has no KVM support, this will cause a major loss of performance."
|
||||
else
|
||||
error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance."
|
||||
error "See the FAQ on how to diagnose the cause, or continue without KVM by setting KVM=N (not recommended)."
|
||||
else
|
||||
kernel=$(uname -a)
|
||||
case "${kernel,,}" in
|
||||
*"microsoft"* )
|
||||
error "Please bind '/dev/kvm' as a volume in the optional container settings when using Docker Desktop." ;;
|
||||
*"synology"* )
|
||||
error "Please make sure that Synology VMM (Virtual Machine Manager) is installed and that '/dev/kvm' is binded to this container." ;;
|
||||
*)
|
||||
error "KVM acceleration is not available $KVM_ERR, this will cause a major loss of performance."
|
||||
error "See the FAQ for possible causes, or continue without it by adding KVM: \"N\" (not recommended)." ;;
|
||||
esac
|
||||
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue