-
-
Notifications
You must be signed in to change notification settings - Fork 658
/
Copy pathDockerfile.x86
54 lines (42 loc) · 1.59 KB
/
Dockerfile.x86
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
# Stage 1: Download all dependencies
FROM ubuntu:24.04 AS dependencies
RUN apt-get update && apt-get install -y --no-install-recommends cmake git \
unzip build-essential ca-certificates curl zip unzip tar \
pkg-config ninja-build autoconf automake libtool \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /opt
COPY vcpkg.json /opt
RUN vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ') \
&& echo "vcpkg commit ID: $vcpkgCommitId" \
&& git clone https://github.com/Microsoft/vcpkg.git \
&& cd vcpkg \
&& git checkout $vcpkgCommitId \
&& ./bootstrap-vcpkg.sh
WORKDIR /opt/vcpkg
COPY vcpkg.json /opt/vcpkg/
RUN /opt/vcpkg/vcpkg --feature-flags=binarycaching,manifests,versions install
# Stage 2: create build
FROM dependencies AS build
COPY . /srv/
WORKDIR /srv
RUN export VCPKG_ROOT=/opt/vcpkg/ && cmake --preset linux-release && cmake --build --preset linux-release
# Stage 3: load data and execute
FROM ubuntu:24.04
VOLUME [ "/data" ]
COPY --from=build /srv/build/linux-release/bin/canary /bin/canary
COPY LICENSE *.sql key.pem /canary/
COPY data /canary/data
COPY data-canary /canary/data-canary
COPY data-otservbr-global /canary/data-otservbr-global
COPY config.lua.dist /canary/config.lua
WORKDIR /canary
RUN apt-get update && apt-get install -y --no-install-recommends \
mariadb-client curl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY docker/data/01-test_account.sql 01-test_account.sql
COPY docker/data/02-test_account_players.sql 02-test_account_players.sql
COPY docker/data/start.sh start.sh
ENTRYPOINT ["/canary/start.sh"]