File tree Expand file tree Collapse file tree 5 files changed +49
-12
lines changed
Expand file tree Collapse file tree 5 files changed +49
-12
lines changed Original file line number Diff line number Diff line change 1- *
2- ! src
3- ! Cargo. *
1+ target /
Original file line number Diff line number Diff line change 7474 run : cargo deny check advisories bans sources
7575 continue-on-error : true
7676
77+ build-docker :
78+ name : build docker image
79+ needs : check
80+ runs-on : ubuntu-latest
81+ steps :
82+ - uses : actions/checkout@v4
83+ - name : Set up QEMU
84+ uses : docker/setup-qemu-action@v3
85+ - name : Set up Docker Buildx
86+ uses : docker/setup-buildx-action@v3
87+ - name : Build Docker image
88+ uses : docker/build-push-action@v6
89+ with :
90+ platforms : linux/amd64,linux/arm64
91+ context : .
92+ push : false
93+ tags : ${{ steps.meta.outputs.tags }}
94+ labels : ${{ steps.meta.outputs.labels }}
95+
7796 publish-dry-run :
7897 name : publish dry run
7998 needs : tests
Original file line number Diff line number Diff line change 2929 with :
3030 images : ${{ env.IMAGE_NAME }}
3131
32+ - name : Set up QEMU
33+ uses : docker/setup-qemu-action@v3
34+
35+ - name : Set up Docker Buildx
36+ uses : docker/setup-buildx-action@v3
37+
3238 - name : Build and push Docker image
33- uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
39+ uses : docker/build-push-action@v6
3440 with :
41+ platforms : linux/amd64,linux/arm64
3542 context : .
3643 push : true
3744 tags : ${{ steps.meta.outputs.tags }}
Original file line number Diff line number Diff line change 3434 with :
3535 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
3636
37+ - name : Set up QEMU
38+ uses : docker/setup-qemu-action@v3
39+
40+ - name : Set up Docker Buildx
41+ uses : docker/setup-buildx-action@v3
42+
3743 - name : Build and push Docker image
38- uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
44+ uses : docker/build-push-action@v6
3945 with :
46+ platforms : linux/amd64,linux/arm64
4047 context : .
4148 push : true
4249 tags : ${{ steps.meta.outputs.tags }}
Original file line number Diff line number Diff line change 1- FROM ekidd/ rust-musl-builder:latest as builder
1+ FROM rust:alpine3.21 as builder
22
3- ADD --chown=rust:rust . ./
4- RUN cargo build --release
3+ WORKDIR /app
4+
5+ COPY . ./
6+ RUN apk update && \
7+ apk add musl-dev jq && \
8+ cargo build --release --message-format=json > build.json
9+ # copy binary to a new location
10+ RUN jq -r '.executable | select(. != null)' build.json | xargs -I '{}' cp '{}' /app
511
612# final image
713FROM alpine:latest
@@ -10,8 +16,8 @@ LABEL name="ssd-benchmark"
1016LABEL org.opencontainers.image.source="https://github.com/sassman/ssd-benchmark-rs"
1117LABEL repository="https://github.com/sassman/ssd-benchmark-rs"
1218LABEL homepage="https://github.com/sassman/ssd-benchmark-rs"
13- LABEL maintainer="Sven Assmann "
19+ LABEL maintainer="Sven Kanoldt <sven@d34dl0ck.me> "
1420
15- COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release /ssd-benchmark \
16- /usr/local/bin/
17- CMD /usr/local/bin/ssd-benchmark
21+ COPY --from=builder /app /ssd-benchmark \
22+ /usr/local/bin/
23+ CMD /usr/local/bin/ssd-benchmark
You can’t perform that action at this time.
0 commit comments