diff --git a/BUILDING.md b/BUILDING.md index 0cee2b7..bad8377 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,5 +1,10 @@ # Building from Source +## Dependencies + +* `make` - needed to build openssl via vendor feature +* `perl` - needed to build openssl via vendor feature + ## Using Cargo A debug build is straightforward: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7888e3a..929ee7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.16.4] - 2022-06-01 ### Added - Dockerfile using Alpine linux with a basic install of distant, tagged as - `chipsenkbeil/distant:0.16.3` + `chipsenkbeil/distant:0.16.3` and `chipsenkbeil/distant:0.16.4` ### Fixed - [Issue #90](https://github.com/chipsenkbeil/distant/issues/90) diff --git a/Dockerfile b/Dockerfile index 37e8bc5..e2bc695 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM alpine:3 - -# Install curl so we can download the distant binary -RUN apk add --no-cache curl - -# 1. Specify the distant version -# 2. Download the MUSL artifact as alpine uses musl -# 3. Make the binary executable -ARG distant_version=0.16.4 -ARG distant_url=https://github.com/chipsenkbeil/distant/releases/download/v${distant_version}/distant-linux64-musl -RUN curl -L ${distant_url} > /usr/local/bin/distant && chmod +x /usr/local/bin/distant +FROM rust:alpine AS builder +# make & perl needed for openssl vendor build +# musl-dev needed, otherwise crti.o is missing +RUN apk add --no-cache make musl-dev perl +WORKDIR /usr/src/distant +COPY . . +# NOTE: For musl clients, there is a bug with wezterm-ssh's libssh-rs that +# prevents us from linking to it; so, we have to exclude it for musl +RUN cargo build --release --no-default-features --features ssh2 +FROM alpine:3 +COPY --from=builder /usr/src/distant/target/release/distant /usr/local/bin/distant ENTRYPOINT ["/usr/local/bin/distant"]