Skip to content

Instantly share code, notes, and snippets.

@bucketsize
Last active January 15, 2020 14:17
Show Gist options
  • Save bucketsize/b80314df46336d46e374b8e5feb74d8c to your computer and use it in GitHub Desktop.
Save bucketsize/b80314df46336d46e374b8e5feb74d8c to your computer and use it in GitHub Desktop.
Dockerfile and launch script for ubuntu-18.04 steam container
#!/bin/sh
sudo xhost +
docker run -ti --rm \
-e DISPLAY=unix$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(pwd)/data/:/home/jb/ \
ubuntu-18.04_custom bash
FROM ubuntu:18.04
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y software-properties-common sudo
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get upgrade -y --fix-missing
RUN apt-get install -y libgl1-mesa-dri:i386 libgl1-mesa-glx:i386
RUN add-apt-repository multiverse && apt-get update
#RUN apt-get remove -y --purge steam-launcher steam-installer steam-devices steam && apt autoremove -y
RUN apt-get install -y steam steam-devices
# Replace 1000 with your user / group id
RUN export uid=1000 gid=1000 && \
mkdir -p /home/jb /etc/sudoers.d && \
echo "jb:x:${uid}:${gid}:Developer,,,:/home/jb:/bin/bash" >> /etc/passwd && \
echo "jb:x:${uid}:" >> /etc/group && \
echo "jb ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jb && \
chmod 0440 /etc/sudoers.d/jb && \
chown ${uid}:${gid} -R /home/jb
USER jb
ENV HOME /home/jb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment