Dosbox v0.74 based on lacsap/dosbox but with alpine so it's down to 10MB! Now with audio!!
3.2K
This Dockerfile will create an image from which you can run a dosbox container. The dosbox config file is located in the /root/.dosbox/ volume, and the /dosbox volume will be where you write your data. If you write anywhere but in those two directory (/dosbox and /root/.dosbox/) you will lose that data once you destroy the container.
There are currently 3 versions with matching docker hub tags:
Create a folder for dosbox in your home directory:
mkdir $HOME/dosbox
Download the run script from here:
Make it executable:
chmod a+x run-*
Run it:
./run-noaudio
NB: If you want to bypass the dosbox startup, you can optionally pass a command to the run script, e.g. run-noaudio /bin/sh
Allow your xhost to connect to the docker container
xhost +local:docker
Choose the appropriate options:
Pick the image you need:
Specify a volume for dosbox
-v /path/to/dosboxapp:/dosbox
If you want to run on a local host's X display, you need:
--env=DISPLAY=unix$DISPLAY
-v /tmp/.X11-unix:/tmp/.X11-unix:ro
If you want to use your local host's pulseaudio, you need:
To get your local user ID and group ID:
export USER_UID=$(id -u)
export USER_GID=$(id -g)
and pass that to the image:
--env=USER_UID=$USER_UID
--env=USER_GID=$USER_GID
And connect as that user and group id to pulseaudio:
-v /dev/shm:/dev/shm
-v $HOME/.config/pulse:/home/gamer/.config/pulse:ro
-v /run/user/$USER_UID/pulse:/run/pulse:ro
Put it all together:
export USER_UID=$(id -u)
export USER_GID=$(id -g)
xhost +local:docker
docker run -ti \
--env=DISPLAY=unix$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:ro \
--env=USER_UID=$USER_UID \
--env=USER_GID=$USER_GID \
-v /dev/shm:/dev/shm \
-v $HOME/.config/pulse:/home/gamer/.config/pulse:ro \
-v /run/user/$USER_UID/pulse:/run/pulse:ro \
-v $HOME/dosbox:/dosbox \
--name dosbox \
tudorh/dosbox:hostpulse
MOUNT C /dosbox in the prompt to mount your data volume in dosbox. (you can automate this by putting the mount command at the end of dosbox's config file)xhost -local:docker to re-enable the access control to the X server.Content type
Image
Digest
Size
11.8 MB
Last updated
almost 8 years ago
docker pull tudorh/dosbox