diff --git a/apps/cli/test/builder/data/Dockerfile b/apps/cli/test/builder/data/Dockerfile index a40f388f..713be177 100644 --- a/apps/cli/test/builder/data/Dockerfile +++ b/apps/cli/test/builder/data/Dockerfile @@ -1,2 +1,5 @@ +FROM --platform=linux/riscv64 ubuntu:22.04 AS test +ADD ./file2 . + FROM --platform=linux/riscv64 ubuntu:22.04 ADD ./file1 . diff --git a/apps/cli/test/builder/data/file2 b/apps/cli/test/builder/data/file2 new file mode 100644 index 00000000..e69de29b diff --git a/apps/cli/test/builder/docker.test.ts b/apps/cli/test/builder/docker.test.ts index 7c7b3ace..3f1b75ca 100644 --- a/apps/cli/test/builder/docker.test.ts +++ b/apps/cli/test/builder/docker.test.ts @@ -47,6 +47,27 @@ describe("when building with the docker builder", () => { ); }); + tmpdirTest( + "should build an ext2 drive with a target definition", + async ({ tmpdir }) => { + const destination = tmpdir; + const drive: DockerDriveConfig = { + builder: "docker", + context: path.join(__dirname, "data"), + dockerfile: path.join(__dirname, "data", "Dockerfile"), + extraSize: 0, + format: "ext2", + tags: [], + image: undefined, + target: "test", + }; + await build("root", drive, image, destination); + const filename = path.join(destination, "root.ext2"); + const stat = fs.statSync(filename); + expect(stat.size).toEqual(76087296); + }, + ); + tmpdirTest("should build an ext2 drive", async ({ tmpdir }) => { const destination = tmpdir; const drive: DockerDriveConfig = {