From 00e8f6c971a8a91bbaea5528a98134082ba26eb8 Mon Sep 17 00:00:00 2001 From: Ben Kristinsson Date: Fri, 16 Sep 2022 10:12:00 +0200 Subject: [PATCH] info in README, fixed up Dockerfile --- Dockerfile | 7 ++++--- README.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ build.sh | 3 +++ steam.sh | 11 +++++++++++ 4 files changed, 62 insertions(+), 3 deletions(-) create mode 100755 build.sh create mode 100755 steam.sh diff --git a/Dockerfile b/Dockerfile index b9745ac..778572b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,8 +10,8 @@ RUN apt-get update -y && \ apt-get clean && \ rm -rf /tmp/* -ENV UID 1000 -ENV USERNAME ben +ARG UID=1000 +ARG USERNAME=player RUN useradd -u ${UID} -G video,adm,sudo -ms /bin/bash ${USERNAME} USER ${USERNAME} @@ -20,4 +20,5 @@ WORKDIR /home/${USERNAME} ENV USER ${USERNAME} ENV HOME /home/${USERNAME} -CMD /bin/bash +ENTRYPOINT ["playonlinux"] +CMD [] diff --git a/README.md b/README.md index df8da51..f103bba 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,46 @@ # playonlinux-docker +a docker container with PlayOnLinux, base image is Ubuntu 22.04. + +## build + +with default `$USERNAME=player` and `$UID=1000`: + +```shell +docker build -t playonlinux . +``` + +if you need or want to use a different UID or username: + +```shell +docker build --build-arg UID=1001 --build-arg USERNAME=user -t playonlinux . +``` + +## run + +start PlayOnLinux: + +```shell +mkdir ~/playonlinux + +docker run --rm -it --privileged \ + --device /dev/dri/card0:/dev/dri/card0 \ + -e DISPLAY=:0 \ + -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ + -v /dev/snd:/dev/snd:rw \ + -v ~/playonlinux:/home/ben:rw \ + playonlinux +``` + +starting Steam: + +```shell +docker run --rm -it --privileged \ + --device /dev/dri/card0:/dev/dri/card0 \ + -e DISPLAY=:0 \ + -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ + -v /dev/snd:/dev/snd:rw \ + -v ~/playonlinux:/home/ben:rw \ + playonlinux --run Steam +``` + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..0fd1ff7 --- /dev/null +++ b/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker build --build-arg UID=1000 --build-arg USERNAME=ben -t playonlinux . diff --git a/steam.sh b/steam.sh new file mode 100755 index 0000000..0743ba8 --- /dev/null +++ b/steam.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +mkdir -p ~/playonlinux + +docker run --rm -it --privileged \ + --device /dev/dri/card0:/dev/dri/card0 \ + -e DISPLAY=:0 \ + -v /tmp/.X11-unix:/tmp/.X11-unix:rw \ + -v /dev/snd:/dev/snd:rw \ + -v ~/playonlinux:/home/ben:rw \ + playonlinux --run Steam