Created
January 25, 2023 08:31
-
-
Save johan149/75c271918cc2d4602fec28d749420f5a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is copied from: https://github.com/k4yt3x/simple-http-server/blob/master/Dockerfile | |
# LICENS: BSD 2-Clause "Simplified" License | |
# please see https://github.com/k4yt3x/simple-http-server/blob/master/LICENSE for more details | |
FROM rust:1.61-alpine3.15 as builder | |
# branch name or tag | |
ARG BRANCH | |
RUN apk add --no-cache --virtual .build-deps git make musl-dev openssl-dev perl pkgconfig \ | |
&& git clone -b $BRANCH https://github.com/TheWaWaR/simple-http-server.git /simple-http-server \ | |
&& RUSTFLAGS='-C link-arg=-s' cargo build \ | |
--release \ | |
--target x86_64-unknown-linux-musl \ | |
--manifest-path=/simple-http-server/Cargo.toml | |
FROM gcr.io/distroless/static:nonroot | |
LABEL maintainer="thewawar <[email protected]>" \ | |
org.opencontainers.image.source="https://github.com/TheWaWaR/simple-http-server" \ | |
org.opencontainers.image.description="A minimal distroless container image for TheWaWaR/simple-http-server" | |
COPY --from=builder \ | |
/simple-http-server/target/x86_64-unknown-linux-musl/release/simple-http-server \ | |
/usr/local/bin/simple-http-server | |
USER nonroot:nonroot | |
WORKDIR /var/www/html | |
ENTRYPOINT ["/usr/local/bin/simple-http-server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment