Skip to content

Commit

Permalink
readme.md for details
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrizt committed Dec 13, 2024
1 parent 6b3bfd6 commit 08d4cc5
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 18 deletions.
42 changes: 41 additions & 1 deletion .docker-build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
docker build -f Dockerfile . -t shrizt/dosbox
#!/bin/bash

# Display menu options to the user
echo "Please choose an option:"
echo "1. Build :latest"
echo "2. Build :pa"
echo "3. Push :latest"
echo "4. Push :pa"
echo "5. Exit"

# Read user input
read -p "Enter your choice [1-5]: " choice

# Perform action based on the user input
case $choice in
1)
echo "($date): Building :latest"
docker build -f Dockerfile . -t shrizt/dosbox
;;
2)
echo "($date): Building :latest"
docker build -f Dockerfile-pa . -t shrizt/dosbox:pa
;;
3)
echo "($date): Push :latest:"
docker push shrizt/dosbox:latest
;;
4)
echo "($date): Push :pa"
docker push shrizt/dosbox:pa
;;
5)
echo "Exiting... Goodbye!"
exit 0
;;
*)
echo "Invalid option. Please choose a number between 1 and 5."
;;
esac





3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ RUN sed -i 's/main/main contrib/g' /etc/apt/sources.list && \
lwm xterm procps curl ca-certificates \
zip unzip nano pwgen inotify-tools && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY startvnc.sh /usr/local/bin/

COPY start.sh /usr/local/bin/
COPY start.sh startdosbox.sh startvnc.sh /usr/local/bin/

COPY stopcont.sh cont.sh stop.sh /usr/local/bin/

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-pa
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ RUN sed -i 's/main/main contrib/g' /etc/apt/sources.list && \
zip unzip nano pwgen inotify-tools \
pulseaudio fluidsynth libfluidsynth-dev fluid-soundfont-gm qsynth && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY startvnc.sh /usr/local/bin/

#copy pulseaudio config files
COPY default.pa client.conf /etc/pulse/

COPY start.sh /usr/local/bin/
COPY start.sh startdosbox.sh startvnc.sh /usr/local/bin/

COPY stopcont.sh cont.sh stop.sh /usr/local/bin/

Expand Down
97 changes: 88 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# DOSBox for Docker Server
## DOSBox for Docker Server

2022-11-17 New push highlights:
- new debian-buster-slim base
- new DosBox auto-sleep feature (read below)
This image provides a DOSBox environment and a VNC console for it, running on
port 5901 (no local X needed - fully virtual desktop).

# 2024-12-12 New push highlights:
- added autorun.sh to /config mounted dir, so you may easy add start-up commands, file will be created and +x if not exists on launch
- DosBox launch script added to infinite loop, so if your DOS game/app is halted - just press CTRL-F9 to close DosBox - it will restart promptly
- below added compose stack config example to run few DosBox hosts for network games
...more in release_notes on GitHub

Any feedback and ideas are highly appreciated and welcome to shrizt(9)gmail.c0m! :)

This image provides a DOSBox environment and a VNC console for it, running on
port 5901 (no local X needed - fully virtual desktop).
# Tags
* :latest - latest with no sound support (smaller, may be more stable for some DOS apps)
* :pa - with sound (pulseaudio) support - including wav and midi devices

# Super feature added
Now you may set ENV VAR DOSBOXSLEEP=1 - and DosBox will automatically go to sleep mode when VNC session disconnected and come back to live on connection. This really helps if you need to run few DosBox containers and will save you a lot of CPU usage/power.
# AUTOSLEEP feature
You may set ENV VAR AUTOSLEEP=1 - and DosBox and pulseaudio will automatically go to sleep mode when VNC session disconnected and come back to live on connection. This really helps if you need to run few DosBox containers and will save you a lot of CPU/power usage.
Sleep/Restore logged in stdout.

# Install and run
Expand Down Expand Up @@ -68,9 +73,83 @@ child images may alter these defaults.
You may put commands to execute on start up at the end of /config/dosbox.conf file.
Setting fullscreen=1 will launch DosBox as kiosk.

# Network compose (few hosts example)

Check you have a bridge network with name my-bridge and ip addresses in range (or correct below)
```
---
version: "3.4"
x-common-variables: &common-variables
PUID: 1002
PGID: 100
TZ: Europe/Moscow
VNCPASSWORD: 12345678
VNCGEOMETRY: 640x480
VNCDEPTH: 16
AUTOSLEEP: 0 #for stable networking both hosts may sleep simultaneously only, I use separate script for it
VNCPORT: 5901
x-common-keys-core: &common-keys
#image: shrizt/dosbox:pa
image: shrizt/dosbox:latest
security_opt:
- no-new-privileges:true
restart: unless-stopped
networks:
my-bridge:
external: true
services:
dosnet1:
<<: *common-keys
container_name: dosnet1
hostname: dosnet1
healthcheck:
test: ["CMD", "pgrep", "dosbox"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
environment:
<<: *common-variables
SOME_CUSTOM_VAR: 2
volumes:
- /path/on/host/dosnet1:/config
networks:
my-bridge:
ipv4_address: 172.21.0.231
dosnet2:
<<: *common-keys
container_name: dosnet2
hostname: dosnet2
depends_on: #start this host after 1, so ipxnet server started first
dosnet1:
condition: service_healthy
environment:
<<: *common-variables
SOME_CUSTOM_VAR: 1
volumes:
- /path/on/host/dosnet2:/config
networks:
my-bridge:
ipv4_address: 172.21.0.232
```

First host should execute (you may add it to /config/dosbox.conf)
>ipxnet startserver
Other hosts must exec
>ipxnet connect dosnet1
Have a happy networking!

# Source / Ext links

Some logging and startup procedures improved, configuration made to be managed externaly with ease.
Some logging and startup procedures improved, configuration made to be managed externally with ease.
New source now here: https://github.com/Shrizt/docker-dosbox

Using DosBox inside: https://www.dosbox.com/
3 changes: 3 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ echo "d:\start.bat" >> /dos/dosbox.conf
sed -i 's/usescancodes=true/usescancodes=false/' /dos/dosbox.conf
# Limit cycles to 25000 to reduce CPU utilization
sed -i 's/cycles=auto/cycles=25000/' /dos/dosbox.conf
# ipxnet enable
sed -i 's/ipx=false/ipx=true/' /dos/dosbox.conf


# Convenience aliases
cd /usr/local/bin
Expand Down
13 changes: 9 additions & 4 deletions start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ echo "starting vnc script..."

echo "Creating /config/drive_d if not exist to mount into DOSBOX"
#make drive_d dir if not exist
LOGDIR=/config/log
export LOGDIR=/config/log
mkdir -p /config/drive_d
mkdir -p $LOGDIR
#create and +x autorun.sh file in config dir if not exist
touch /config/autorun.sh
chmod +x /config/autorun.sh


DOSBOXCFG=/config/dosbox.conf
export DOSBOXCFG=/config/dosbox.conf
if [ -f "$DOSBOXCFG" ]; then
echo "Using $DOSBOXCFG. If you need to load defaults - remove $DOSBOXCFG"
else
Expand All @@ -44,8 +47,10 @@ fi

echo "Starting /usr/bin/xterm &"
/usr/bin/xterm &
echo "Starting dosbox... >/usr/bin/dosbox -conf $DOSBOXCFG &"
/usr/bin/dosbox -conf $DOSBOXCFG &>$LOGDIR/dosbox.log &
echo "Executing startdosbox.sh..."
/usr/local/bin/startdosbox.sh &
echo "Executing /config/autorun.sh script..."
/config/autorun.sh &
echo "### Start-up finished. VNC connections watcher start"
/usr/local/bin/stopcont.sh

Expand Down

0 comments on commit 08d4cc5

Please sign in to comment.