diff --git a/Dockerfile b/Dockerfile index 7b262e6..ae3cceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -260,9 +260,9 @@ VOLUME ["/tmp/.X11-unix"] # the default serial numbers are already contained in ./OpenCore-Catalina/OpenCore.qcow2 # And the default serial numbers -CMD case "$(file --brief /image)" in \ +CMD sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" "${BOOTDISK}" 2>/dev/null || true \ + ; case "$(file --brief /image)" in \ QEMU\ QCOW2\ Image* ) export IMAGE_PATH=/image \ - ; sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" 2>/dev/null || true \ ;; \ directory* ) export IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img \ ;; \ @@ -287,7 +287,6 @@ CMD case "$(file --brief /image)" in \ --output-bootdisk "${BOOTDISK:-/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ ; case "$(file --brief /bootdisk)" in \ QEMU\ QCOW2\ Image* ) export BOOTDISK=/bootdisk \ - ; sudo chown "$(id -u)":"$(id -g)" "${BOOTDISK}" 2>/dev/null || true \ ;; \ directory* ) export BOOTDISK=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2 \ ;; \ diff --git a/Dockerfile.auto b/Dockerfile.auto index 0d466fc..3c59fa6 100644 --- a/Dockerfile.auto +++ b/Dockerfile.auto @@ -137,7 +137,8 @@ ENV TERMS_OF_USE=i_agree ENV BOILERPLATE="By using this Dockerfile, you hereby agree that you are a security reseacher or developer and agree to use this Dockerfile to make the world a safer place. Examples include: making your apps safer, finding your mobile phone, compiling security products, etc. You understand that Docker-OSX is an Open Source project, which is released to the public under the GNU Pulic License version 3 and above. You acknowledge that the Open Source project is absolutely unaffiliated with any third party, in any form whatsoever. Any trademarks or intelectual property which happen to be mentioned anywhere in or around the project are owned by their respective owners. By using this Dockerfile, you agree to agree to the EULA of each piece of upstream or downstream software. The following code is released for the sole purpose of security research, under the GNU Public License version 3. If you are concerned about the licensing, please note that this project is not AGPL. A copy of the license is available online: https://github.com/sickcodes/Docker-OSX/blob/master/LICENSE. In order to use the following Dockerfile you must read and understand the terms. Once you have read the terms, use the -e TERMS_OF_USE=i_agree or -e TERMS_OF_USE=i_disagree" -CMD echo "${BOILERPLATE}" \ +CMD sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" "${BOOTDISK}" 2>/dev/null || true \ + echo "${BOILERPLATE}" \ && [[ "${TERMS_OF_USE}" = i_agree ]] || exit 1 \ ; [[ "${NOPICKER}" == true ]] && mv ./Launch-nopicker.sh ./Launch.sh \ ; [[ "${GENERATE_UNIQUE}" == true ]] \ @@ -159,7 +160,6 @@ CMD echo "${BOILERPLATE}" \ --output-bootdisk "${BOOTDISK:-/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ ; case "$(file --brief /bootdisk)" in \ QEMU\ QCOW2\ Image* ) export BOOTDISK=/bootdisk \ - ; sudo chown "$(id -u)":"$(id -g)" "${BOOTDISK}" 2>/dev/null || true \ ;; \ directory* ) export BOOTDISK=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2 \ ;; \ @@ -170,7 +170,7 @@ CMD echo "${BOILERPLATE}" \ ; } \ ; echo "Checking whether /image is a directory or a QEMU disk." \ ; case "$(file --brief /image)" in \ - QEMU*) export IMAGE_PATH=/image && sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" 2>/dev/null || true;; \ + QEMU*) export IMAGE_PATH=/image;; \ directory*) export IMAGE_PATH=/home/arch/OSX-KVM/mac_hdd_ng.img;; \ esac \ ; stat "${IMAGE_PATH}" \ diff --git a/Dockerfile.naked b/Dockerfile.naked index 2bb8783..5c76e75 100644 --- a/Dockerfile.naked +++ b/Dockerfile.naked @@ -107,11 +107,11 @@ ENV DISPLAY=:99 ENV IMAGE_PATH=/image -CMD [[ "${DISPLAY}" = ':99' ]] && { \ +CMD sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" "${BOOTDISK}" 2>/dev/null || true \ + ; [[ "${DISPLAY}" = ':99' ]] && { \ nohup Xvfb :99 -screen 0 1920x1080x16 \ & until [[ "$(xrandr --query 2>/dev/null)" ]]; do sleep 1 ; done \ ; } \ - ; sudo chown "$(id -u)":"$(id -g)" "${IMAGE_PATH}" 2>/dev/null || true \ ; [[ "${NOPICKER}" == true ]] && mv ./Launch-nopicker.sh ./Launch.sh \ ; [[ "${GENERATE_UNIQUE}" == true ]] \ && ./Docker-OSX/custom/generate-unique-machine-values.sh \ @@ -132,7 +132,6 @@ CMD [[ "${DISPLAY}" = ':99' ]] && { \ --output-bootdisk "${BOOTDISK:-/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2}" \ ; case "$(file --brief /bootdisk)" in \ QEMU\ QCOW2\ Image* ) export BOOTDISK=/bootdisk \ - ; sudo chown "$(id -u)":"$(id -g)" "${BOOTDISK}" 2>/dev/null || true \ ;; \ directory* ) export BOOTDISK=/home/arch/OSX-KVM/OpenCore-Catalina/OpenCore.qcow2 \ ;; \