From d4d767a3b81f8c432d1470cb7ca2f2e44fe604bd Mon Sep 17 00:00:00 2001
From: Tim deBoer
Date: Wed, 20 Mar 2024 11:11:52 -0400
Subject: [PATCH 1/2] feat: build from local storage
The Bootc image builder added support to build from local storage via
https://github.com/osbuild/bootc-image-builder/issues/90.
This updates to the current bootc image builder image, and adds the two
new required options:
- --local, should be temporary/default soon
- volume mapping to /var/lib/containers/storage
Signed-off-by: Tim deBoer
---
packages/backend/src/build-disk-image.spec.ts | 3 ++-
packages/backend/src/build-disk-image.ts | 4 ++--
packages/backend/src/constants.ts | 2 +-
packages/frontend/src/Build.svelte | 4 ----
4 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/packages/backend/src/build-disk-image.spec.ts b/packages/backend/src/build-disk-image.spec.ts
index 1755cc76..52b0e079 100644
--- a/packages/backend/src/build-disk-image.spec.ts
+++ b/packages/backend/src/build-disk-image.spec.ts
@@ -52,8 +52,9 @@ test('check image builder options', async () => {
expect(options.HostConfig).toBeDefined();
if (options.HostConfig?.Binds) {
expect(options.HostConfig.Binds[0]).toEqual(outputFolder + ':/output/');
+ expect(options.HostConfig.Binds[1]).toEqual('/var/lib/containers/storage:/var/lib/containers/storage');
}
- expect(options.Cmd).toEqual([image, '--type', type, '--target-arch', arch, '--output', '/output/']);
+ expect(options.Cmd).toEqual([image, '--type', type, '--target-arch', arch, '--output', '/output/', '--local']);
});
test('check we pick unused container name', async () => {
diff --git a/packages/backend/src/build-disk-image.ts b/packages/backend/src/build-disk-image.ts
index e27e0b84..4ab759c7 100644
--- a/packages/backend/src/build-disk-image.ts
+++ b/packages/backend/src/build-disk-image.ts
@@ -335,7 +335,7 @@ export function createBuilderImageOptions(
HostConfig: {
Privileged: true,
SecurityOpt: ['label=type:unconfined_t'],
- Binds: [folder + ':/output/'],
+ Binds: [folder + ':/output/', '/var/lib/containers/storage:/var/lib/containers/storage'],
},
// Add the appropriate labels for it to appear correctly in the Podman Desktop UI.
@@ -344,7 +344,7 @@ export function createBuilderImageOptions(
'bootc.build.image.location': imagePath,
'bootc.build.type': type,
},
- Cmd: [image, '--type', type, '--target-arch', arch, '--output', '/output/'],
+ Cmd: [image, '--type', type, '--target-arch', arch, '--output', '/output/','--local'],
};
return options;
diff --git a/packages/backend/src/constants.ts b/packages/backend/src/constants.ts
index c4b44c2d..2810089e 100644
--- a/packages/backend/src/constants.ts
+++ b/packages/backend/src/constants.ts
@@ -18,4 +18,4 @@
// Image related
export const bootcImageBuilderContainerName = '-bootc-image-builder';
-export const bootcImageBuilderName = 'quay.io/centos-bootc/bootc-image-builder:latest-1708009307';
+export const bootcImageBuilderName = 'quay.io/centos-bootc/bootc-image-builder:latest-1710916056';
diff --git a/packages/frontend/src/Build.svelte b/packages/frontend/src/Build.svelte
index e5bc5c41..5f1db09d 100644
--- a/packages/frontend/src/Build.svelte
+++ b/packages/frontend/src/Build.svelte
@@ -230,10 +230,6 @@ $: {
>.
{/if}
-
- Note: All images must be pushed to a publically accessible registry in order for our build system to
- "pull" the images. This is TEMPORARY and local image building will be supported in the future.
-