compile statically on musl

This commit is contained in:
Sebastian Hugentobler 2023-03-09 11:38:49 +01:00
parent 85989c7597
commit 339f9626d2
Signed by: shu
GPG Key ID: BB32CF3CA052C2F0

View File

@ -1,7 +1,5 @@
FROM docker.io/rust:1.67-alpine3.17 AS builder FROM docker.io/rust:1.67-alpine3.17 AS builder
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN apk add --no-cache \ RUN apk add --no-cache \
musl-dev \ musl-dev \
wasm-pack \ wasm-pack \
@ -18,7 +16,7 @@ RUN adduser -D woweb
RUN sed -i 's|ws://localhost:3000/ws|wss://woweb.vanwa.ch/ws|' dist/assets/index.js RUN sed -i 's|ws://localhost:3000/ws|wss://woweb.vanwa.ch/ws|' dist/assets/index.js
FROM scratch FROM docker.io/alpine:3.17
COPY --from=builder /etc/passwd /etc/passwd COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /src/dist/woweb "/opt/woweb" COPY --from=builder /src/dist/woweb "/opt/woweb"