Skip to content

Commit

Permalink
Merge pull request #53 from palfrey/static-ssl
Browse files Browse the repository at this point in the history
Linux build wasn't fully static
  • Loading branch information
palfrey committed Jun 18, 2021
2 parents 9dae5f8 + 07e8d57 commit 8550e28
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,13 @@ jobs:
docker run --name wait_for_db wait_for_db --help
- name: Docker copy
run: |
docker cp wait_for_db:/wait_for_db wait-for-db-linux-x86
docker cp wait_for_db:/wait_for_db wait-for-db-linux-x86
- name: ldd check
run: |
ldd wait-for-db-linux-x86 | grep "statically linked"
retVal=$?
if [ $retVal -ne 0 ]; then
ldd wait-for-db-linux-x86
echo Found local non-static refs!
exit 1
fi
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
FROM alpine:3.13 as builder

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

WORKDIR /app
ENV OPENSSL_STATIC=true
ENV OPENSSL_STATIC=yes
ENV OPENSSL_LIB_DIR=/usr/lib
ENV OPENSSL_INCLUDE_DIR=/usr/include
ADD . ./
RUN cargo build --release --target=x86_64-unknown-linux-musl
RUN strip ./target/x86_64-unknown-linux-musl/release/wait_for_db
Expand Down

0 comments on commit 8550e28

Please sign in to comment.