23 lines
786 B
Docker
23 lines
786 B
Docker
|
FROM chewingbever/fej-builder:latest AS builder
|
||
|
|
||
|
# And then finally, build the project
|
||
|
# Thank the lords that this article exists
|
||
|
# https://users.rust-lang.org/t/sigsegv-with-program-linked-against-openssl-in-an-alpine-container/52172
|
||
|
# TODO add what these flags do & why they work
|
||
|
# NOTE: cargo install auto-appends bin to the path
|
||
|
RUN --mount=type=cache,target=/usr/src/app/target \
|
||
|
--mount=type=cache,target=/root/.cargo/registry \
|
||
|
cargo install --path . --bin fej --root /usr/local
|
||
|
|
||
|
|
||
|
# Now, we create the actual image
|
||
|
FROM alpine:latest
|
||
|
|
||
|
# Install some dynamic libraries needed for everything to work
|
||
|
RUN apk update && apk add --no-cache openssl libgcc
|
||
|
|
||
|
# Copy binary over to final image
|
||
|
COPY --from=builder /usr/local/bin/fej /usr/local/bin/fej
|
||
|
|
||
|
CMD ["/usr/local/bin/fej"]
|