Skip to content

Commit 8550e28

Browse files
authored
Merge pull request #53 from palfrey/static-ssl
Linux build wasn't fully static
2 parents 9dae5f8 + 07e8d57 commit 8550e28

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

.github/workflows/linux.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,13 @@ jobs:
6262
docker run --name wait_for_db wait_for_db --help
6363
- name: Docker copy
6464
run: |
65-
docker cp wait_for_db:/wait_for_db wait-for-db-linux-x86
65+
docker cp wait_for_db:/wait_for_db wait-for-db-linux-x86
66+
- name: ldd check
67+
run: |
68+
ldd wait-for-db-linux-x86 | grep "statically linked"
69+
retVal=$?
70+
if [ $retVal -ne 0 ]; then
71+
ldd wait-for-db-linux-x86
72+
echo Found local non-static refs!
73+
exit 1
74+
fi

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
FROM alpine:3.13 as builder
22

3-
RUN apk add --no-cache rustup gcc file unixodbc-dev unixodbc-static libltdl-static musl-dev openssl-dev
3+
RUN apk add --no-cache rustup gcc file unixodbc-dev unixodbc-static libltdl-static musl-dev openssl-dev openssl-libs-static
44
RUN rustup-init -y --default-host x86_64-unknown-linux-musl --profile minimal
55
ENV PATH=$PATH:/root/.cargo/bin
66

77
WORKDIR /app
8-
ENV OPENSSL_STATIC=true
8+
ENV OPENSSL_STATIC=yes
9+
ENV OPENSSL_LIB_DIR=/usr/lib
10+
ENV OPENSSL_INCLUDE_DIR=/usr/include
911
ADD . ./
1012
RUN cargo build --release --target=x86_64-unknown-linux-musl
1113
RUN strip ./target/x86_64-unknown-linux-musl/release/wait_for_db

0 commit comments

Comments
 (0)