-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathDockerfile
59 lines (48 loc) · 1.61 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
# -----------
# Build stage
# -----------
FROM ubuntu:20.04 AS build
LABEL maintainer=jwestp
WORKDIR /stk
# Set stk version that should be built
ENV VERSION=1.1
# Install build dependencies
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --no-install-recommends -y build-essential \
cmake \
git \
libcurl4-openssl-dev \
libenet-dev \
libssl-dev \
pkg-config \
subversion \
zlib1g-dev \
ca-certificates
# Get code and assets
RUN git clone --branch ${VERSION} --depth=1 https://github.com/supertuxkart/stk-code.git
RUN svn checkout https://svn.code.sf.net/p/supertuxkart/code/stk-assets-release/${VERSION}/ stk-assets
# Build server
RUN mkdir stk-code/cmake_build && \
cd stk-code/cmake_build && \
cmake .. -DSERVER_ONLY=ON -USE_SYSTEM_ENET=ON && \
make -j$(nproc) && \
make install
# -----------
# Final stage
# -----------
FROM ubuntu:20.04
LABEL maintainer=jwestp
WORKDIR /stk
# Install libcurl dependency
RUN apt-get update && \
apt-get install --no-install-recommends -y libcurl4-openssl-dev && \
rm -rf /var/lib/apt/lists/*
# Copy artifacts from build stage
COPY --from=build /usr/local/bin/supertuxkart /usr/local/bin
COPY --from=build /usr/local/share/supertuxkart /usr/local/share/supertuxkart
COPY docker-entrypoint.sh docker-entrypoint.sh
# Expose the ports used to find and connect to the server
EXPOSE 2757
EXPOSE 2759
ENTRYPOINT ["/stk/docker-entrypoint.sh"]