Skip to content

Commit 9de9fd6

Browse files
committed
Add docker files
1 parent 61863cf commit 9de9fd6

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

docker/Dockerfile.aarch64

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is copied from: https://github.com/k4yt3x/simple-http-server/blob/master/Dockerfile
2+
# LICENS: BSD 2-Clause "Simplified" License
3+
# please see https://github.com/k4yt3x/simple-http-server/blob/master/LICENSE for more details
4+
5+
FROM rust:1.61-alpine3.15 as builder
6+
# branch name or tag
7+
ARG BRANCH
8+
RUN apk add --no-cache --virtual .build-deps git make musl-dev openssl-dev perl pkgconfig \
9+
&& git clone -b $BRANCH https://github.com/TheWaWaR/simple-http-server.git /simple-http-server \
10+
&& RUSTFLAGS='-C link-arg=-s' cargo build --release --target aarch64-unknown-linux-musl --manifest-path=/simple-http-server/Cargo.toml
11+
12+
FROM gcr.io/distroless/static:nonroot
13+
LABEL maintainer="thewawar <thewawar@gmail.com>" \
14+
org.opencontainers.image.source="https://github.com/TheWaWaR/simple-http-server" \
15+
org.opencontainers.image.description="A minimal distroless container image for TheWaWaR/simple-http-server"
16+
COPY --from=builder \
17+
/simple-http-server/target/aarch64-unknown-linux-musl/release/simple-http-server \
18+
/usr/local/bin/simple-http-server
19+
USER nonroot:nonroot
20+
WORKDIR /var/www/html
21+
ENTRYPOINT ["/usr/local/bin/simple-http-server"]

docker/Dockerfile.x86_64

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is copied from: https://github.com/k4yt3x/simple-http-server/blob/master/Dockerfile
2+
# LICENS: BSD 2-Clause "Simplified" License
3+
# please see https://github.com/k4yt3x/simple-http-server/blob/master/LICENSE for more details
4+
5+
FROM rust:1.61-alpine3.15 as builder
6+
# branch name or tag
7+
ARG BRANCH
8+
RUN apk add --no-cache --virtual .build-deps git make musl-dev openssl-dev perl pkgconfig \
9+
&& git clone -b $BRANCH https://github.com/TheWaWaR/simple-http-server.git /simple-http-server \
10+
&& RUSTFLAGS='-C link-arg=-s' cargo build --release --target x86_64-unknown-linux-musl --manifest-path=/simple-http-server/Cargo.toml
11+
12+
FROM gcr.io/distroless/static:nonroot
13+
LABEL maintainer="thewawar <thewawar@gmail.com>" \
14+
org.opencontainers.image.source="https://github.com/TheWaWaR/simple-http-server" \
15+
org.opencontainers.image.description="A minimal distroless container image for TheWaWaR/simple-http-server"
16+
COPY --from=builder \
17+
/simple-http-server/target/x86_64-unknown-linux-musl/release/simple-http-server \
18+
/usr/local/bin/simple-http-server
19+
USER nonroot:nonroot
20+
WORKDIR /var/www/html
21+
ENTRYPOINT ["/usr/local/bin/simple-http-server"]

0 commit comments

Comments
 (0)