-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
62 lines (54 loc) · 1.82 KB
/
Dockerfile
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
57
58
59
60
61
62
#
# Build stage
#
FROM ubuntu:20.04 AS build-stage
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies
RUN set -xe; \
apt-get update; \
apt-get install --no-install-recommends -y \
cmake make g++ protobuf-compiler patch \
qtbase5-dev libqt5opengl5-dev libprotobuf-dev; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/*;
RUN useradd --create-home --shell /bin/bash default
WORKDIR /home/default
COPY . .
RUN set -xe; \
mkdir build; \
cd build; \
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..; \
make autoref autoref-cli -j $(nproc)
##
## Run stage
##
FROM ubuntu:20.04
ARG DEBIAN_FRONTEND=noninteractive
RUN set -xe; \
apt-get update; \
apt-get install --no-install-recommends -y \
qtbase5-dev libqt5opengl5-dev libprotobuf-dev \
x11vnc xvfb \
tini ; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/*;
RUN useradd --create-home --shell /bin/bash default
WORKDIR /home/default
COPY --chown=default:default --from=build-stage /home/default/COPYING COPYING
COPY --chown=default:default --from=build-stage /home/default/LICENSE LICENSE
COPY --chown=default:default --from=build-stage /home/default/src/framework/strategy/lua src/framework/strategy/lua/
COPY --chown=default:default --from=build-stage /home/default/autoref autoref/
COPY --chown=default:default --from=build-stage /home/default/build/bin build/bin/
# COPY --chown just changes permissions on the inner folder. We need to aquire
# the outer one as well
RUN chown default:default build/
COPY --chown=default:default --from=build-stage /home/default/data data/
COPY --chown=default:default --from=build-stage /home/default/config config/
COPY --chown=default:default docker-entry.bash /
USER default
# Ports
# 5900 - vnc
# Ports used by SSL protocols are documented here
# https://ssl.robocup.org/league-software/
EXPOSE 5900
ENTRYPOINT ["tini", "--", "/docker-entry.bash"]