Skip to content

Commit 299456e

Browse files
committed
Add userid argument in Dockerfile.
Should fix #45.
1 parent edd4453 commit 299456e

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
FROM python:3.7-stretch
22
LABEL maintainer "[email protected]"
33

4+
ARG userid=1000
5+
46
RUN apt-get update && \
57
pip install pygame
68

79
COPY ./requirements.txt /requirements.txt
810
RUN pip install -r /requirements.txt
911
COPY ./ app/
1012
RUN cd app/ && python setup.py install
11-
RUN useradd -m -U -s /bin/bash pygame
13+
RUN useradd -m -U -s /bin/bash -u $userid pygame
1214

1315
USER pygame
1416
WORKDIR /home/pygame

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,15 @@ commmon code patterns I find while using PyGame.
1515
as this relies on language features only available from there.
1616

1717
# Development
18-
Aside from `.travis.yml`, the Dockerfile is provided for development. You can
19-
also pull the image via
18+
19+
Aside from `.travis.yml`, the Dockerfile is provided for development. The
20+
Dockerfile takes an argument `userid` which should be a user id outside the
21+
container that has access to `/tmp/.X11-unix`. If you are in a graphical desktop
22+
environment, it would suffice to pass the `$UID` environment variable like so,
23+
24+
docker build -t pygame-objects --build-arg userid=$UID .
25+
26+
You can also pull the image via
2027

2128
docker run skytreader/pygame-objects:latest
2229

0 commit comments

Comments
 (0)