Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 903daf6

Browse files
authored
changed workload image arch to wasi/wasm (#42)
Signed-off-by: jiaxiao zhou <[email protected]>
1 parent 7aa63c3 commit 903daf6

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
_dist/slight_workload.yaml#example-slight-workloads
4646
4747
for f in ./_artifacts/*/*.tar.gz; do gh release upload ${{ env.RELEASE_VERSION }} $f; done
48+
49+
# Setup buildx to build multiarch image: https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md
50+
- name: Set up QEMU
51+
uses: docker/setup-qemu-action@v2
4852
- name: setup buildx
4953
uses: docker/setup-buildx-action@v2
5054
- name: login to GitHub container registry
@@ -61,6 +65,16 @@ jobs:
6165
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:${{ env.RELEASE_VERSION }}
6266
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-rust-hello:latest
6367
context: images/spin
68+
platforms: wasi/wasm
69+
- name: build and push Spin DotNet
70+
uses: docker/build-push-action@v3
71+
with:
72+
push: true
73+
tags: |
74+
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-dotnet-hello:${{ env.RELEASE_VERSION }}
75+
ghcr.io/deislabs/containerd-wasm-shims/examples/spin-dotnet-hello:latest
76+
context: images/spin_dotnet
77+
platforms: wasi/wasm
6478
- name: build and push Slight hello world
6579
uses: docker/build-push-action@v3
6680
with:
@@ -69,6 +83,7 @@ jobs:
6983
ghcr.io/deislabs/containerd-wasm-shims/examples/slight-rust-hello:${{ env.RELEASE_VERSION }}
7084
ghcr.io/deislabs/containerd-wasm-shims/examples/slight-rust-hello:latest
7185
context: images/slight
86+
platforms: wasi/wasm
7287
- name: untar x86_64 musl artifacts into ./deployments/k3d/.tmp dir
7388
run: |
7489
mkdir -p ./deployments/k3d/.tmp

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ update-deps:
4242

4343
test/out_spin/img.tar: images/spin/Dockerfile
4444
mkdir -p $(@D)
45-
docker build -t $(TEST_IMG_NAME_SPIN) ./images/spin
45+
docker buildx build --platform=wasi/wasm -t $(TEST_IMG_NAME_SPIN) ./images/spin
4646
docker save -o $@ $(TEST_IMG_NAME_SPIN)
4747

4848
test/out_slight/img.tar: images/slight/Dockerfile
4949
mkdir -p $(@D)
50-
docker build -t $(TEST_IMG_NAME_SLIGHT) ./images/slight
50+
docker buildx build --platform=wasi/wasm -t $(TEST_IMG_NAME_SLIGHT) ./images/slight
5151
docker save -o $@ $(TEST_IMG_NAME_SLIGHT)
5252

5353
load: test/out_spin/img.tar test/out_slight/img.tar

images/slight/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.64 AS build
1+
FROM --platform=${BUILDPLATFORM} rust:1.64 AS build
22
WORKDIR /opt/build
33
COPY . .
44
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release

images/spin/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.59 AS build
1+
FROM --platform=${BUILDPLATFORM} rust:1.59 AS build
22
WORKDIR /opt/build
33
COPY . .
44
RUN rustup target add wasm32-wasi && cargo build --target wasm32-wasi --release

images/spin_dotnet/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim-amd64 AS build
1+
FROM --platform=${BUILDPLATFORM} mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim-amd64 AS build
22
WORKDIR /opt/build
33
COPY . .
44
RUN apt-get update && apt-get install xz-utils

0 commit comments

Comments
 (0)