This repository has been archived on 2025-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
Files
glyph/support/Containerfile
Nikolaos Karaolidis ec7055d5ff Initial commit
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-06-04 22:50:18 +01:00

28 lines
766 B
Docker

FROM docker.io/library/rust AS builder
ARG BUILD_MODE=debug
RUN apt-get update && apt-get install -y musl-tools && apt-get clean
RUN rustup target add x86_64-unknown-linux-musl
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo fetch
RUN rm -rf src
COPY src ./src
RUN cargo build --target=x86_64-unknown-linux-musl $(if [ "$BUILD_MODE" = "release" ]; then echo "--release"; else echo ""; fi)
RUN mkdir -p build && cp target/x86_64-unknown-linux-musl/$(if [ "$BUILD_MODE" = "release" ]; then echo "release"; else echo "debug"; fi)/glyph build/glyph
FROM docker.io/library/alpine
COPY --from=builder /app/build/glyph /usr/local/bin/glyph
EXPOSE 8080/tcp
ENTRYPOINT ["/usr/local/bin/glyph"]
CMD ["--help"]