From b8a8f0c6d2bfc2def1adf0e95efa2caa1638826c Mon Sep 17 00:00:00 2001 From: ymage Date: Mon, 16 Mar 2020 09:14:06 +0100 Subject: [PATCH] Fix alpine build with openssl crate as default Make openssl crate as default (non feature-flipped) Make static build --- docker/Dockerfile.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/Dockerfile.j2 b/docker/Dockerfile.j2 index 16f16239..30f17c5b 100644 --- a/docker/Dockerfile.j2 +++ b/docker/Dockerfile.j2 @@ -71,6 +71,7 @@ RUN rustup set profile minimal {% if "alpine" in target_file %} ENV USER "root" +ENV RUSTFLAGS='-C link-arg=-s' {% elif "aarch64" in target_file or "armv" in target_file %} # Install required build libs for {{ package_arch_name }} architecture. @@ -202,6 +203,9 @@ COPY . . # Make sure that we actually build the project RUN touch src/main.rs +{% if "alpine" in target_file %} +RUN sed -i '/#\[cfg(feature = "openssl")\]/d' src/main.rs +{% endif %} # Builds again, this time it'll just be # your actual source files being built