File tree Expand file tree Collapse file tree 2 files changed +29
-14
lines changed Expand file tree Collapse file tree 2 files changed +29
-14
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,18 @@ jobs:
195
195
- name : Set up Docker Buildx
196
196
uses : docker/setup-buildx-action@v2
197
197
198
+ - uses : actions/download-artifact@v3
199
+ with :
200
+ name : wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
201
+ path : ./artifacts
202
+ - run : mv ./artifacts/wadm ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64 && chmod +x ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
203
+
204
+ - uses : actions/download-artifact@v3
205
+ with :
206
+ name : wadm-${{ env.RELEASE_VERSION }}-linux-amd64
207
+ path : ./artifacts
208
+ - run : mv ./artifacts/wadm ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64 && chmod +x ./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64
209
+
198
210
- name : Login to GitHub Container Registry
199
211
uses : docker/login-action@v2
200
212
with :
@@ -211,6 +223,11 @@ jobs:
211
223
if : startsWith(github.ref, 'refs/tags/v')
212
224
with :
213
225
push : true
226
+ platforms : linux/amd64,linux/arm64
227
+ context : ./
228
+ build-args : |
229
+ BIN_ARM64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-aarch64
230
+ BIN_AMD64=./artifacts/wadm-${{ env.RELEASE_VERSION }}-linux-amd64
214
231
tags : ghcr.io/${{ env.OWNER }}/wadm:latest,ghcr.io/${{ env.OWNER }}/wadm:${{ env.RELEASE_VERSION }}
215
232
216
233
- name : Build and push (main)
Original file line number Diff line number Diff line change 1
- FROM rust:1.68.0 -slim as builder
1
+ FROM debian:bullseye -slim AS base
2
2
3
- WORKDIR /usr/src/wadm
3
+ FROM base AS base-amd64
4
+ ARG BIN_AMD64
5
+ ARG BIN=$BIN_AMD64
4
6
5
- COPY . /usr/src/wadm/
7
+ FROM base AS base-arm64
8
+ ARG BIN_ARM64
9
+ ARG BIN=$BIN_ARM64
6
10
7
- RUN rustup target add x86_64-unknown-linux-musl
8
- RUN apt update && apt install -y musl-tools musl-dev
9
- RUN update-ca-certificates
10
-
11
- RUN cargo build --bin wadm --features cli --target x86_64-unknown-linux-musl --release
12
-
13
- FROM alpine:3.16.0 AS runtime
11
+ FROM base-$TARGETARCH
14
12
15
13
ARG USERNAME=wadm
16
14
ARG USER_UID=1000
17
15
ARG USER_GID=$USER_UID
18
16
19
- RUN addgroup -g $USER_GID $USERNAME \
20
- && adduser -D -u $USER_UID -G $USERNAME $USERNAME
17
+ RUN addgroup --gid $USER_GID $USERNAME \
18
+ && adduser --disabled-login -u $USER_UID --ingroup $USERNAME $USERNAME
21
19
22
- # Copy application binary from builder image
23
- COPY --from=builder -- chown=$USERNAME /usr/src/wadm/target/x86_64-unknown-linux-musl/release/wadm /usr/local/bin/wadm
20
+ # Copy application binary from disk
21
+ COPY --chown=$USERNAME ${BIN} /usr/local/bin/wadm
24
22
25
23
USER $USERNAME
26
24
# Run the application
You can’t perform that action at this time.
0 commit comments