Skip to content

Commit a3d4ef7

Browse files
committed
šŸ› fix: add env vars to docker cargo build because of problem in rust language ( rust-lang/rust#59302)
1 parent e475fbc commit a3d4ef7

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ā€ŽDockerfile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ RUN apk add python3
1111

1212
# copy cargo files to build dependencies
1313
COPY ./Cargo.toml ./
14-
#COPY ./Cargo.lock ./
1514

1615
# create dummy .rs file for build caching
1716
RUN mkdir ./src && mkdir ./src/bin && echo 'fn main() {println!("Dummy!"); }' > ./src/bin/service_main.rs
@@ -28,10 +27,9 @@ RUN touch -a -m ./src/bin/service_main.rs
2827

2928
RUN cargo build
3029

31-
# # use slim version of debian to run release build
32-
# FROM debian:bullseye
33-
# COPY --from=rust-builder /app/target/release/service_main /usr/local/bin
34-
35-
# WORKDIR /usr/local/bin
3630
COPY config.json config.json
31+
32+
#https://github.com/rust-lang/rust/issues/59302
33+
ENV RUSTFLAGS="-C target-feature=-crt-static"
34+
3735
ENTRYPOINT ["./target/debug/service_main", "--config-file", "./config.json"]

0 commit comments

Comments
Ā (0)