Skip to content

Instantly share code, notes, and snippets.

@vsoch

vsoch/Dockerfile

Last active Aug 25, 2020
Embed
What would you like to do?
Dolmades Files
FROM ubuntu:16.04
LABEL version="1.0"
ENTRYPOINT [ "/singularity" ]
RUN mkdir -p /APPS /PROFILES
RUN chmod 0777 /APPS /PROFILES
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get -y install wget less vim software-properties-common python3-software-properties apt-transport-https winbind
RUN wget https://dl.winehq.org/wine-builds/Release.key
RUN apt-key add Release.key
RUN apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/
RUN apt-get update && apt-get install -y winehq-stable winetricks # this installs Wine2
RUN apt-get clean
COPY singularity.sh /singularity
RUN chmod 0755 /singularity
#!/bin/bash
TEMPDIR="$(mktemp -d)"
echo "Creating and changing into temporary directory $TEMPDIR..."
cd "$TEMPDIR"
APPDIR="/APPS"
PROFILEDIR="/PROFILES/${USER}@${HOSTNAME}"
echo "Setting up wine prefix..."
export WINEPREFIX="$TEMPDIR/wineprefix"
export WINEARCH="win32"
if [[ -f "$APPDIR/wineprefix.tgz" ]]; then
echo "Found existing wineprefix - restoring it..."
mkdir -p "$WINEPREFIX"
cd "$WINEPREFIX"
tar xzf "$APPDIR/wineprefix.tgz"
else
wineboot --init
echo "Installing DirectX9..."
winetricks dlls d3dx9
fi
echo "Containerizing apps directory..."
if [[ -L "$WINEPREFIX/drive_c/Apps" ]]; then
echo "Link exists already"
else
ln -sf "$APPDIR" "$WINEPREFIX/drive_c/Apps"
echo "Link created"
fi
echo "Containerizing user profile..."
if [[ -d "$PROFILEDIR" ]]; then
rm -rf "$WINEPREFIX/drive_c/users/$USER"
else
echo "This user profile is newly generated..."
mv "$WINEPREFIX/drive_c/users/$USER" "$PROFILEDIR"
fi
ln -s "$PROFILEDIR" "$WINEPREFIX/drive_c/users/$USER"
echo "Please install your GOG windows game now or play it"
echo "To install Broken Sword 2.5 (download size ~700MB):"
echo " wget http://server.c-otto.de/baphometsfluch/bs25setup.zip"
echo " unzip bs25setup.zip"
echo " wine ./bs25-setup.exe"
echo "Use the Apps directory to make it install permanently!"
cd $TEMPDIR
env WINEPREFIX="$WINEPREFIX" WINEARCH="$WINEARCH" /bin/bash
wineboot --end-session
echo "Saving last wineprefix..."
cd $WINEPREFIX && tar czf "$APPDIR/wineprefix.tgz" . && sync
cd /
rm -rf "$TEMPDIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.