Skip to content

Instantly share code, notes, and snippets.

@pabzdzdzwiagief
Created February 28, 2015 18:29
Show Gist options
  • Save pabzdzdzwiagief/380810d107fb1688c93d to your computer and use it in GitHub Desktop.
Save pabzdzdzwiagief/380810d107fb1688c93d to your computer and use it in GitHub Desktop.
Isolated environment for programs started with wine.
#!/usr/bin/env sh
cmd="${@:-sudo login -p -f player}"
exec docker run -it --name gogbox --hostname gogbox \
--env="USER_UID=$(id -u)" \
--env="USER_GID=$(id -g)" \
--env="DISPLAY=${DISPLAY}" \
--volume=/run/user/$(id -u)/pulse:/run/pulse \
--volume=/tmp/.X11-unix:/tmp/.X11-unix \
--volume=/dev/dri/card0:/dev/dri/card0 --privileged \
gogbox:latest $cmd
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:ubuntu-wine/ppa
RUN dpkg --add-architecture i386
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y nvidia-331 # must be the same as on host
RUN apt-get update && apt-get install -y \
man \
wget \
curl
RUN apt-get update && apt-get install -y \
dbus-x11 \
pulseaudio \
wine1.7 \
winetricks
RUN apt-get update && apt-get install -y dosbox
RUN apt-get update && apt-get install -y locales
RUN update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX
RUN useradd -m -g games -G audio,video,users -s /bin/dash player
RUN echo "player ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/player
RUN chmod 0440 /etc/sudoers.d/player
USER player
ENV HOME /home/player
ENV WINEARCH win32
RUN echo "export PULSE_SERVER=/run/pulse/native" >> $HOME/.profile
WORKDIR /home/player
VOLUME /home/player
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment