Files
Pumpkin/Dockerfile
Commandcracker 11c2336556 Never strip debug symbols (#679)
* use cargo strip

* Never strip debug symboles

* looks like i had format on save on in nvim

* change the version back

* remove nl

* remove new line
2025-04-03 19:03:00 +02:00

35 lines
1.1 KiB
Docker

FROM rust:1-alpine3.21 AS builder
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk add --no-cache musl-dev \
# Required for git-version
git
WORKDIR /pumpkin
COPY . /pumpkin
RUN rustup show active-toolchain || rustup toolchain install
# build release
RUN --mount=type=cache,sharing=private,target=/pumpkin/target \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/ \
cargo build --release && cp target/release/pumpkin ./pumpkin.release
FROM alpine:3.21
# Identifying information for registries like ghcr.io
LABEL org.opencontainers.image.source=https://github.com/Pumpkin-MC/Pumpkin
RUN apk add --no-cache libgcc
COPY --from=builder /pumpkin/pumpkin.release /bin/pumpkin
# set workdir to /pumpkin, this is required to influence the PWD environment variable
# it allows for bind mounting the server files without overwriting the pumpkin
# executable (without requiring an `docker cp`-ing the binary to the host folder)
WORKDIR /pumpkin
ENV RUST_BACKTRACE=1
EXPOSE 25565
ENTRYPOINT [ "/bin/pumpkin" ]