Skip to content

Commit

Permalink
try a debian arm build
Browse files Browse the repository at this point in the history
  • Loading branch information
akostadinov committed Nov 4, 2024
1 parent 5d7620d commit 1af4bd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/container-image-buildah.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Sanitize Platforms
id: platforms
run: |
platforms="${{ inputs.platforms == '' && 'linux/amd64' || inputs.platforms }}"
platforms="${{ inputs.platforms == '' && 'linux/amd64,linux/arm64' || inputs.platforms }}"
archs="$( sed -e 's#linux/##g' <<< $platforms )"
echo "platforms=$platforms" >> $GITHUB_OUTPUT
echo "archs=$archs" >> $GITHUB_OUTPUT
Expand Down
15 changes: 10 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Build stage
FROM rust:1.72-alpine3.18 AS cargo-build
FROM rust:1.72.1-bookworm AS cargo-build

RUN apk add --no-cache musl-dev pkgconfig openssl-dev
RUN apt-get update
RUN apt-get install -y libgcc-12-dev libc6-dev pkg-config libssl-dev

WORKDIR /src/websocat
ENV RUSTFLAGS='-Ctarget-feature=-crt-static'

COPY Cargo.toml Cargo.toml
ARG CARGO_OPTS="--features=workaround1,seqpacket,prometheus_peer,prometheus/process,crypto_peer"
# ARG CARGO_OPTS="--features=workaround1,seqpacket,prometheus_peer,prometheus/process,crypto_peer"
ARG CARGO_OPTS="--features=ssl,workaround1,seqpacket,unix_stdio,prometheus_peer,prometheus/process,crypto_peer"

RUN mkdir src/ &&\
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
Expand All @@ -19,9 +21,12 @@ RUN cargo build --release $CARGO_OPTS && \
strip target/release/websocat

# Final stage
FROM alpine:3.18
FROM debian:bookworm

RUN apk add --no-cache libgcc
RUN apt-get update
RUN apt-get install -y libssl3
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY --from=cargo-build /src/websocat/target/release/websocat /usr/local/bin/
Expand Down

0 comments on commit 1af4bd8

Please sign in to comment.