Skip to content

Commit

Permalink
fixup! feat(cli): build based on configuration
Browse files Browse the repository at this point in the history
docker build with target
  • Loading branch information
tuler committed Oct 16, 2024
1 parent 0909525 commit fc06d6d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/cli/test/builder/data/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
FROM --platform=linux/riscv64 ubuntu:22.04 AS test
ADD ./file2 .

FROM --platform=linux/riscv64 ubuntu:22.04
ADD ./file1 .
Empty file.
21 changes: 21 additions & 0 deletions apps/cli/test/builder/docker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit fc06d6d

Please sign in to comment.