diff --git a/.changeset/big-ghosts-rescue.md b/.changeset/big-ghosts-rescue.md new file mode 100644 index 00000000..4794ee5b --- /dev/null +++ b/.changeset/big-ghosts-rescue.md @@ -0,0 +1,5 @@ +--- +"@cartesi/cli": patch +--- + +enforce build for linux/riscv64 platform diff --git a/apps/cli/src/builder/docker.ts b/apps/cli/src/builder/docker.ts index 98826482..7dc63dbf 100644 --- a/apps/cli/src/builder/docker.ts +++ b/apps/cli/src/builder/docker.ts @@ -26,6 +26,8 @@ const buildImage = async (options: ImageBuildOptions): Promise => { const args = [ "buildx", "build", + "--platform", + "linux/riscv64", "--file", dockerfile, "--load", diff --git a/apps/cli/test/builder/data/Dockerfile.nonriscv b/apps/cli/test/builder/data/Dockerfile.nonriscv deleted file mode 100644 index 95ea117f..00000000 --- a/apps/cli/test/builder/data/Dockerfile.nonriscv +++ /dev/null @@ -1,2 +0,0 @@ -FROM scratch -ADD ./file1 . diff --git a/apps/cli/test/builder/docker.test.ts b/apps/cli/test/builder/docker.test.ts index b6c73bea..495fdf41 100644 --- a/apps/cli/test/builder/docker.test.ts +++ b/apps/cli/test/builder/docker.test.ts @@ -35,11 +35,10 @@ describe("when building with the docker builder", () => { const drive: DockerDriveConfig = { builder: "docker", context: path.join(__dirname, "data"), - dockerfile: path.join(__dirname, "data", "Dockerfile.nonriscv"), extraSize: 0, format: "ext2", tags: [], - image: undefined, + image: "debian:bookworm-slim", target: undefined, }; await expect(build("root", drive, image, destination)).rejects.toThrow(