Update docker-wine.

This commit is contained in:
giomba 2022-12-09 20:14:02 +01:00
parent a247af714a
commit f69cb8689c

View File

@ -17,6 +17,8 @@ print_help () {
echo " --tag=VALUE Specify an image tag to use (default is latest)" echo " --tag=VALUE Specify an image tag to use (default is latest)"
echo " --name=VALUE Name of the docker container instantiated" echo " --name=VALUE Name of the docker container instantiated"
echo " (default is 'wine')" echo " (default is 'wine')"
echo " --arm64 Start the containter using linux/arm64 platform for ARM"
echo " and Apple Silicon (M1) native image"
echo " --as-root Start the container as root" echo " --as-root Start the container as root"
echo " --as-me Start the container using your current username, UID and" echo " --as-me Start the container using your current username, UID and"
echo " GID (default when alternate --home value specified)" echo " GID (default when alternate --home value specified)"
@ -67,6 +69,7 @@ print_help () {
echo " container (default is /home/\$USER)" echo " container (default is /home/\$USER)"
echo " --force-owner Allow the user to take ownership of a home volume that" echo " --force-owner Allow the user to take ownership of a home volume that"
echo " belongs to another user (NOTE: Use with caution!)" echo " belongs to another user (NOTE: Use with caution!)"
echo " --nosudo Disable sudo for the user"
echo " --password=VALUE Specify a password for the user in plain text (default" echo " --password=VALUE Specify a password for the user in plain text (default"
echo " is the user's username)" echo " is the user's username)"
echo " --password-prompt Prompt to set a password for the user" echo " --password-prompt Prompt to set a password for the user"
@ -76,6 +79,9 @@ print_help () {
echo " --env=VALUE Specify additional environment variable(s) to be passed" echo " --env=VALUE Specify additional environment variable(s) to be passed"
echo " to the container. Uses standard docker syntax and" echo " to the container. Uses standard docker syntax and"
echo " multiple statements are allowed" echo " multiple statements are allowed"
echo " --mount=VALUE Specify additional directory bindings. Uses"
echo " standard docker syntax and multiple statements are"
echo " allowed"
echo " --network=VALUE Specify the network to connect the container to. Uses" echo " --network=VALUE Specify the network to connect the container to. Uses"
echo " standard docker syntax" echo " standard docker syntax"
echo " --volume=VALUE Specify additional volume(s) to be mounted. Uses" echo " --volume=VALUE Specify additional volume(s) to be mounted. Uses"
@ -180,20 +186,23 @@ configure_xquartz () {
fi fi
# Configure XQuartz # Configure XQuartz
if [ "$(defaults read org.macosforge.xquartz.X11 app_to_run)" != "/usr/bin/true" ]; then if [ -e ~/Library/Preferences/org.xquartz.X11.plist ] ; then
defaults write org.macosforge.xquartz.X11 app_to_run /usr/bin/true xquartz_properties=org.xquartz.X11
else xquartz_properties=org.macosforge.xquartz.X11; fi
if [ "$(defaults read $xquartz_properties app_to_run)" != "/usr/bin/true" ]; then
defaults write $xquartz_properties app_to_run /usr/bin/true
changes_made=0 changes_made=0
fi fi
if [ "$(defaults read org.macosforge.xquartz.X11 nolisten_tcp)" != "0" ]; then if [ "$(defaults read $xquartz_properties nolisten_tcp)" != "0" ]; then
defaults write org.macosforge.xquartz.X11 nolisten_tcp 0 defaults write $xquartz_properties nolisten_tcp 0
changes_made=0 changes_made=0
fi fi
if [ "$(defaults read org.macosforge.xquartz.X11 enable_iglx)" != "1" ]; then if [ "$(defaults read $xquartz_properties enable_iglx)" != "1" ]; then
# Enable GLX (OpenGL) # Enable GLX (OpenGL)
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true defaults write $xquartz_properties enable_iglx -bool true
changes_made=0 changes_made=0
fi fi
@ -218,7 +227,7 @@ install_xquartz() {
# Install XQuartz # Install XQuartz
if ! [ -f /opt/X11/bin/xquartz ]; then if ! [ -f /opt/X11/bin/xquartz ]; then
brew cask install xquartz brew install --cask xquartz
# Confirm installed # Confirm installed
[ -f /opt/X11/bin/xquartz ] && installed=0 [ -f /opt/X11/bin/xquartz ] && installed=0
@ -417,6 +426,10 @@ while [ $# -gt 0 ]; do
--name=*) --name=*)
CONTAINER_NAME="${1#*=}" CONTAINER_NAME="${1#*=}"
;; ;;
--arm64)
add_run_arg --platform="linux/arm64"
IMAGE_TAG="arm64"
;;
--as-root) --as-root)
add_run_arg --env="RUN_AS_ROOT=yes" add_run_arg --env="RUN_AS_ROOT=yes"
WORKDIR="/" WORKDIR="/"
@ -465,6 +478,9 @@ while [ $# -gt 0 ]; do
--force-owner) --force-owner)
add_run_arg --env="FORCED_OWNERSHIP=yes" add_run_arg --env="FORCED_OWNERSHIP=yes"
;; ;;
--nosudo)
add_run_arg --env="USER_SUDO=no"
;;
--password=*) --password=*)
encrypt_password "${1#*=}" encrypt_password "${1#*=}"
;; ;;
@ -476,7 +492,7 @@ while [ $# -gt 0 ]; do
--secure-password=*) --secure-password=*)
add_run_arg --env="USER_PASSWD=${1#*=}" add_run_arg --env="USER_PASSWD=${1#*=}"
;; ;;
--device=*|--env=*|--network=*|--volume=*) --device=*|--env=*|--mount=*|--network=*|--volume=*)
add_run_arg "$1" add_run_arg "$1"
;; ;;
--workdir=*) --workdir=*)