mirror of
https://github.com/davegallant/rfd-notify.git
synced 2025-08-07 00:58:12 +00:00
Fix musl build (#103)
This commit is contained in:
18
Dockerfile
18
Dockerfile
@@ -1,14 +1,18 @@
|
|||||||
FROM rust@sha256:f91b3dae52c0d99302366331e36cf6af8a923d36c68577df1f4d5a7c2721ca90 as build
|
FROM rust:1.54-buster@sha256:f91b3dae52c0d99302366331e36cf6af8a923d36c68577df1f4d5a7c2721ca90 as build
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get -y install \
|
RUN apt update && \
|
||||||
|
apt -y install \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
musl-tools
|
musl-tools \
|
||||||
|
musl-dev
|
||||||
|
|
||||||
RUN rustup target add x86_64-unknown-linux-musl
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
RUN update-ca-certificates
|
||||||
|
|
||||||
WORKDIR /usr/src/rfd-notify
|
WORKDIR /usr/src/rfd-notify
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.toml
|
COPY Cargo.toml Cargo.toml
|
||||||
@@ -16,17 +20,19 @@ COPY src src
|
|||||||
|
|
||||||
ENV PKG_CONFIG_ALLOW_CROSS=1
|
ENV PKG_CONFIG_ALLOW_CROSS=1
|
||||||
|
|
||||||
RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
|
RUN cargo build --target=x86_64-unknown-linux-musl --release
|
||||||
|
|
||||||
RUN mkdir /examples
|
RUN mkdir /examples
|
||||||
|
|
||||||
COPY examples /examples
|
COPY examples /examples
|
||||||
|
|
||||||
|
### Final lightweight image
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
COPY --from=build /examples /examples
|
COPY --from=build /examples /examples
|
||||||
|
|
||||||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
COPY --from=build /usr/src/rfd-notify/target/x86_64-unknown-linux-musl/release/rfd-notify .
|
COPY --from=build /usr/src/rfd-notify/target/x86_64-unknown-linux-musl/release/rfd-notify ./rfd-notify
|
||||||
|
|
||||||
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||||
ENV SSL_CERT_DIR=/etc/ssl/certs
|
ENV SSL_CERT_DIR=/etc/ssl/certs
|
||||||
|
Reference in New Issue
Block a user