Initial commit
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
27
support/Containerfile
Normal file
27
support/Containerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
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"]
|
Reference in New Issue
Block a user