-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (33 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM rust:1-bookworm as builder
RUN apt-get update && apt-get install -y \
ca-certificates \
dumb-init \
libgtk-4-dev \
librsvg2-dev
WORKDIR /app
COPY . .
RUN cargo build --bins --release
RUN ldd target/release/favicon-rs
# Hack to get shared libraries into the scratch image
RUN <<ENDRUN
ldd target/release/favicon-rs | cut -f 3 -d ' ' | awk NF | grep -v "^[a-z]" | sort >sharedlibs.txt
cat sharedlibs.txt
mkdir -p libs
cp $(cat sharedlibs.txt) libs
ENDRUN
#CMD ["./target/release/favicon-rs"]
#FROM scratch
FROM debian:bookworm-slim
LABEL org.opencontainers.image.source https://github.com/FileFormatInfo/favicon-rs
ARG COMMIT="(not set)"
ARG LASTMOD="(not set)"
ENV COMMIT=$COMMIT
ENV LASTMOD=$LASTMOD
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/bin/dumb-init /usr/bin/dumb-init
COPY --from=builder /app/target/release/favicon-rs /app/favicon-rs
COPY --from=builder /app/libs /lib/x86_64-linux-gnu
COPY ./static /app/static
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["/app/favicon-rs"]