-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (22 loc) · 959 Bytes
/
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
FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc-multilib \
libcap-dev \
make \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN make -C TimeChanger/src/ WhiteListCaps.so \
&& cp TimeChanger/src/WhiteListCaps.so /usr/lib/ \
&& chmod 755 /usr/lib/WhiteListCaps.so
RUN cp Server/config.json /etc/NetworkClock.json \
&& sed -ie 's/^\s*"ChangeTimeBin"\s*:\s*"[^"]*"\s*$/ "ChangeTimeBin": "\/app\/TimeChanger\/src\/ChangeTime"/' /etc/NetworkClock.json \
&& chmod 644 /etc/NetworkClock.json
RUN make -C TimeChanger/src/ ChangeTime \
&& chmod +x TimeChanger/src/SetSUID.sh \
&& ./TimeChanger/src/SetSUID.sh #Nastavý potřebná práva
RUN dotnet build --configuration Release Server/
CMD ["dotnet", "run", "--configuration", "Release", "--project", "Server/"]