-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.plotlabserver
56 lines (37 loc) · 1.54 KB
/
Dockerfile.plotlabserver
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
# This dockerfile contains the runtime context for plotlabserver
# with integration into x11 for graphical applications
ARG PLOTLABSERVER_TAG=latest
ARG USER=plotlabserver
ARG UID
ARG GID
FROM plotlabserver_build:${PLOTLABSERVER_TAG} AS plotlabserver_build
FROM ubuntu:20.04 as plotlabserver
ENV DISPLAY_MODE=native
ENV DEBIAN_FRONTEND=noninteractive
ARG DISPLAY
ENV DISPLAY=${DISPLAY}
ENV DEBIAN_FRONTEND noninteractive
ARG USER=plotlabserver
ARG UID
ARG GID
RUN useradd --create-home ${USER}
RUN usermod -u ${UID} ${USER} && groupmod -g ${GID} ${USER}
RUN chown -R ${UID}:${GID} $$HOME | true
ARG VIRTUAL_DISPLAY_RESOLUTION=800x600
ENV VIRTUAL_DISPLAY_RESOLUTION=${VIRTUAL_DISPLAY_RESOLUTION}
ARG VIRTUAL_DISPLAY_ID=":99"
ENV VIRTUAL_DISPLAY_ID=${VIRTUAL_DISPLAY_ID}
ARG REQUIREMENTS_FILE="files/requirements.plotlabserver.ubuntu20.04.runtime.system"
COPY --from=plotlabserver_build /tmp/plotlabserver /tmp/plotlabserver
WORKDIR /tmp/plotlabserver
RUN apt-get update && \
apt-get install --no-install-recommends -y $(sed '/^#/d' ${REQUIREMENTS_FILE} | sed '/^$/d') && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install --no-install-recommends -y unclutter xdotool ffmpeg xvfb xserver-xephyr i3 #x11-apps
COPY files/.config /home/${USER}/.config
RUN mkdir -p /var/log/plotlab && chown -R ${UID}:${GID} /var/log/plotlab
# Creates virtual display as root so that normal users can call Xvfb on same display
RUN timeout .1 Xvfb :99 | true
USER ${USER}
WORKDIR /tmp/plotlabserver/files
ENTRYPOINT bash plotlabserver_entrypoint.sh