mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
docker: include Alpine base tools, tini
Including tini fixes forwarding signals to MinedMap, allowing to interrupt it using Ctrl-C. The base tools may be used to add a wrapper script to configure MinedMap with environment variables. As the Alpine base is included now, we can switch from the rust:alpine image to alpine:latest, resulting in MinedMap to be linked dynamically.
This commit is contained in:
parent
cb0aa235db
commit
3b5ce82873
2 changed files with 13 additions and 8 deletions
4
.dockerignore
Normal file
4
.dockerignore
Normal file
|
@ -0,0 +1,4 @@
|
|||
*
|
||||
!/Cargo.*
|
||||
!/src
|
||||
!/crates
|
17
Dockerfile
17
Dockerfile
|
@ -1,14 +1,15 @@
|
|||
FROM docker.io/library/rust:alpine AS BUILDER
|
||||
FROM docker.io/library/alpine:latest AS BUILDER
|
||||
|
||||
WORKDIR /build
|
||||
RUN apk update && apk add cmake build-base
|
||||
RUN apk add --no-cache build-base cmake cargo
|
||||
|
||||
COPY src /build/src
|
||||
COPY crates /build/crates
|
||||
COPY Cargo.toml Cargo.lock /build
|
||||
COPY . .
|
||||
RUN cargo build -r
|
||||
RUN strip target/release/minedmap
|
||||
|
||||
FROM scratch AS RUNNER
|
||||
FROM docker.io/library/alpine:latest
|
||||
|
||||
COPY --from=BUILDER /build/target/release/minedmap /minedmap
|
||||
ENTRYPOINT [ "/minedmap" ]
|
||||
RUN apk add --no-cache libgcc tini
|
||||
|
||||
COPY --from=BUILDER /build/target/release/minedmap /bin/minedmap
|
||||
ENTRYPOINT [ "/sbin/tini", "--", "/bin/minedmap" ]
|
||||
|
|
Loading…
Add table
Reference in a new issue