This repository was archived by the owner on Feb 8, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (51 loc) · 2.39 KB
/
Dockerfile
File metadata and controls
64 lines (51 loc) · 2.39 KB
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
63
64
# Build stage with Rust 1.88
FROM rust:1.88-bullseye AS builder
# System dependencies for Linux32/64 and Windows32/64 cross-compilation
RUN dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
gcc-multilib g++-multilib \
gcc-mingw-w64-i686 g++-mingw-w64-i686 \
gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 \
liblua5.1-0-dev \
curl git pkg-config musl-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Take into account your rust-toolchain.toml for nightly, etc.
COPY rust-toolchain.toml .
COPY . .
RUN echo "→ build Linux 32-bits" \
&& cargo build --release --target i686-unknown-linux-gnu
RUN echo "→ build Linux 64-bits" \
&& cargo build --release --target x86_64-unknown-linux-gnu
RUN echo "→ build Windows 32-bits" \
&& cargo build --release --target i686-pc-windows-gnu
RUN echo "→ build Windows 64-bits" \
&& cargo build --release --target x86_64-pc-windows-gnu
# Artifacts extraction stage
FROM debian:bullseye-slim AS runtime
RUN mkdir -p /out
# Copy compiled artifacts
# Linux 32-bits
COPY --from=builder /build/target/i686-unknown-linux-gnu/release/libgmod_integration_loader.so \
/out/gmsv_gmod_integration_loader_linux.dll
COPY --from=builder /build/target/i686-unknown-linux-gnu/release/libgmod_integration.so \
/out/gmsv_gmod_integration_linux.dll
# Linux 64-bits
COPY --from=builder /build/target/x86_64-unknown-linux-gnu/release/libgmod_integration_loader.so \
/out/gmsv_gmod_integration_loader_linux64.dll
COPY --from=builder /build/target/x86_64-unknown-linux-gnu/release/libgmod_integration.so \
/out/gmsv_gmod_integration_linux64.dll
# Windows 32-bits
COPY --from=builder /build/target/i686-pc-windows-gnu/release/gmod_integration_loader.dll \
/out/gmsv_gmod_integration_loader_win32.dll
COPY --from=builder /build/target/i686-pc-windows-gnu/release/gmod_integration.dll \
/out/gmsv_gmod_integration_win32.dll
# Windows 64-bits
COPY --from=builder /build/target/x86_64-pc-windows-gnu/release/gmod_integration_loader.dll \
/out/gmsv_gmod_integration_loader_win64.dll
COPY --from=builder /build/target/x86_64-pc-windows-gnu/release/gmod_integration.dll \
/out/gmsv_gmod_integration_win64.dll
# Use to extract artifacts
CMD ["true"]