Public | Automated Build

Last pushed: a year ago
Short Description
Dosbox v0.74 based on lacsap/dosbox but with alpine so it's down to 10MB! Now with audio!!
Full Description

dosbox in a container

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:

  • noaudio - Audio is disabled
  • host-pulse - Use your host's pulseaudio
  • remote - Runs headless so you can connect via VNC/RDesktop (In Progress - Probably available w/e March 31, 2017)

How to use it


  1. Create a folder for dosbox in your home directory:

     mkdir $HOME/dosbox
  2. Download the run script from here:

  3. Make it executable:

     chmod a+x run-*
  4. Run it:


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


  1. Allow your xhost to connect to the docker container

    xhost +local:docker

  2. Choose the appropriate options:

    1. Pick the image you need:

      • tudorh/dosbox:noaudio - for a local X without audio
      • tudorh/dosbox:hostpulse - for a local X with audio based on pulseaudio
      • tudorh/dosbox:remote - for a non-local X
    2. Specify a volume for dosbox

       -v /path/to/dosboxapp:/dosbox
    3. If you want to run on a local host's X display, you need:

       -v /tmp/.X11-unix:/tmp/.X11-unix:ro
1. 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:


    * 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
  1. 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 \

Using and configuring dosbox

  • after dosbox is launched, type 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)


  • When you are done using dosbox you should probably run xhost -local:docker to re-enable the access control to the X server.
Docker Pull Command
Source Repository