Daniel Sheffield 1 year ago
commit
b1cdfd4b4c
3 changed files with 101 additions and 0 deletions
  1. 17 0
      Dockerfile
  2. 35 0
      docker-compose.yml
  3. 49 0
      start-the-neverhood.sh

+ 17 - 0
Dockerfile

@@ -0,0 +1,17 @@
+FROM scottyhardy/docker-wine
+ADD the_neverhood_data.tar.xz /home/wineuser/
+ADD .wine-win95.tar.xz /home/wineuser/
+#RUN mkdir /home/wineuser
+RUN chown -R 0:0 /home/wineuser
+#RUN find /home/wineuser/.wine-win95
+#USER wineuser
+#USER 1010
+ENV WINEPREFIX /home/wineuser/.wine-win95
+ENV WINEARCH win32
+RUN winetricks win95 dsound
+#RUN rm /home/wineuser/.wine-win95/dosdevices/e\:/ && mv /home/wineuser/the_neverhood_data  /home/wineuser/.wine-win95/dosdevices/e\:/
+RUN ln -sf /home/wineuser/the_neverhood_data /home/wineuser/.wine-win95/dosdevices/e\:
+COPY system.reg /home/wineuser/.wine-win95/system.reg
+#RUN winetricks d3dx9_36
+#RUN winetricks sound=pulse
+#RUN winetricks list-all 

+ 35 - 0
docker-compose.yml

@@ -0,0 +1,35 @@
+version: '2.4'
+
+services:
+
+  the-neverhood:
+    environment:
+      DISPLAY: ":0.0"
+        #PULSE_COOKIE: /tmp/pulseaudio.cookie
+        #PULSE_SERVER: unix:/tmp/pulseaudio.socket
+      XDG_RUNTIME_DIR: /run/user/1000
+    image: the-neverhood #scottyhardy/docker-wine:latest
+      #hostname: yottaLbox
+    working_dir: /home/wineuser/
+    #privileged: yes
+    entrypoint:
+      - /usr/bin/entrypoint
+      - /home/wineuser/the_neverhood.sh
+    volumes:
+      #- type: bind
+      #  source: ./wine_prefix
+      #  target: /home/wineuser/.wine-win95
+          #- type: bind
+          #source: ./the_neverhood_data
+          #target: /home/wineuser/the_neverhood
+        #mode: ro
+      - ./the_neverhood.sh:/home/wineuser/the_neverhood.sh
+        #- ./system.reg:/home/wineuser/.wine-win95/system.reg
+          #- ~/.Xauthority:/root/.Xauthority:ro
+      - ${HOME}/.docker-wine.Xkey:/root/.Xkey:ro
+      - /etc/localtime:/etc/localtime:ro
+      - /tmp/.X11-unix:/tmp/.X11-unix
+        #- /tmp/pulse-cookie:/tmp/pulse-cookie
+      - /tmp/pulse-socket:/tmp/pulse-socket
+        #- ./pulseaudio-client.conf:/etc/pulse/client.conf
+

+ 49 - 0
start-the-neverhood.sh

@@ -0,0 +1,49 @@
+#!/bin/bash
+set -euo pipefail
+set -x
+GAME=the_neverhood
+cleanup(){
+    echo "Cleaning up..."
+
+    set +euo pipefail
+    docker cp the_neverhood_the-neverhood_1:/home/wineuser/.wine-win95/system.reg $DIR/system.reg
+    #diff -u wine_prefix/system.reg{.old,} >> $DIR/saved_games.patch
+    #diff -u system.reg{.old,} >> $DIR/saved_games.patch
+    #sudo rm -rf wine_prefix
+    #sudo rm -rf the_neverhood_data
+    #sudo rm -f the_neverhood.sh 
+}
+DIR=$(pwd)
+mkdir -p /tmp/${GAME}
+cd /tmp/${GAME}
+trap cleanup INT QUIT EXIT
+#cp $DIR/pulseaudio-client.conf .
+echo "Uncompressing game..."
+#tar xf $DIR/wine_prefix.tar.xz
+#cp $DIR/system.reg system.reg
+
+sudo cp ${DIR}/system.reg $DIR/system.reg.$(date +%Y%m%d-%H%M%S)
+#sudo cp system.reg system.reg.old
+
+# system.reg has the game saves
+# so we patch in our game saves
+# and take a snapshot of current
+# system.reg
+#cp wine_prefix/system.reg $DIR/system.reg.$(date +%Y%m%d-%H%M%S)
+#patch --verbose -p0 < $DIR/saved_games.patch 
+
+#cp system.reg $DIR/system.reg.$(date +%Y%m%d-%H%M%S)
+#patch --verbose -p1 < $DIR/saved_games.patch 
+#cp system.reg{,.old} 
+
+#tar xf $DIR/the_neverhood_data.tar.xz
+cp $DIR/docker-compose.yml .
+#cp $DIR/run.sh .
+sudo cp $DIR/the_neverhood.sh .
+#echo "Setting permissions..."
+#sudo chown -R 1010:1010 wine_prefix
+#sudo chown -R 1010:1010 the_neverhood.sh
+#sudo chown $(id -u):1010 /run/user/$(id -u)/pulse/native
+echo "Starting docker container..."
+docker-compose up
+#./run.sh