Add working docker image

Davide Polonio 2021-09-22 18:04:00 +02:00
parent 10040d1f39
commit f0b904f17e
2 changed files with 11 additions and 8 deletions

View File

@ -1,17 +1,18 @@
FROM rust:1.55.0-alpine3.14 as builder
FROM rust:1.55.0-bullseye as builder
ENV RUSTFLAGS="-C target-feature=+crt-static"
# ENV RUSTFLAGS="-C target-feature=+crt-static"
WORKDIR /build
RUN apk add --no-cache musl-dev \
openssl-dev \
build-base
RUN apt-get update && apt-get install -y \
libssl-dev
COPY ./ /build
RUN cargo build --target x86_64-unknown-linux-musl --release # --verbose && ls -lah /build/target/release/build/ && ls -lah .
RUN cargo build --release
FROM gcr.io/distroless/static
FROM gcr.io/distroless/base
COPY --from=builder /build/target/x86_64-unknown-linux-musl/release/songlify /usr/bin/songlify
COPY --from=builder /build/target/release/songlify /usr/bin/songlify
COPY --from=builder /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib/x86_64-linux-gnu/
COPY --from=builder /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/
ENTRYPOINT /usr/bin/songlify

View File

@ -69,4 +69,6 @@ async fn main() {
respond(())
})
.await;
log::info!("Exiting...");
}