forked from davidpicard/plt
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (41 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
56 lines (41 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM debian:stable-slim AS plt-base
ARG USERNAME
ARG USER_UID
ARG USER_GID
ARG DISPLAY
ARG WAYLAND_DISPLAY
RUN groupadd --gid $USER_GID $USERNAME && \
useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
gdb \
cmake \
lcov \
gcovr \
git
RUN apt-get update && apt-get install -y \
libsfml-dev \
libxml2-dev \
libboost-all-dev
RUN apt-get update && apt-get install -y \
dia libcanberra-gtk3-module \
python3-gi gir1.2-gtk-3.0
# Set up user and working directory
RUN chsh -s /bin/bash $USERNAME
USER $USERNAME
WORKDIR /app
COPY --exclude=build --exclude=cmake-build-debug --chown=$USERNAME:$USERNAME . /app
# Set environment variables for GUI support
RUN [ -z "$WAYLAND_DISPLAY" ] && echo 'export DISPLAY='"$DISPLAY" >> ~/.bashrc && export DISPLAY=$DISPLAY || echo 'export WAYLAND_DISPLAY='"$WAYLAND_DISPLAY" >> /home/plt/.bashrc && export WAYLAND_DISPLAY=$WAYLAND_DISPLAY
RUN [ -z "$WAYLAND_DISPLAY" ] && echo 'export GDK_BACKEND=x11' >> ~/.bashrc && export GDK_BACKEND=x11 || echo "export GDK_BACKEND=wayland" >> /home/plt/.bashrc && export GDK_BACKEND=wayland
RUN [ -z "$WAYLAND_DISPLAY" ] && echo 'export QT_QPA_PLATFORM=xcb' >> ~/.bashrc && export QT_QPA_PLATFORM=xcb || echo "export QT_QPA_PLATFORM=wayland" >> /home/plt/.bashrc && export QT_QPA_PLATFORM=wayland
# Build the project
ENV LC_ALL="C.UTF-8"
ENV LANG="C.UTF-8"
RUN mkdir docker-build && cd docker-build && cmake .. && make client && cd ..
RUN chmod u+x ./entrypoint.sh
SHELL ["/bin/bash", "--login", "-c"]
# Run the application
ENTRYPOINT ["./entrypoint.sh"]
CMD ["tail", "-f", "/dev/null"]