Skip to content

Commit

Permalink
feat: build from local storage
Browse files Browse the repository at this point in the history
The Bootc image builder added support to build from local storage via
osbuild/bootc-image-builder#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 <[email protected]>
  • Loading branch information
deboer-tim committed Mar 20, 2024
1 parent 570a845 commit d4d767a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
3 changes: 2 additions & 1 deletion packages/backend/src/build-disk-image.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/build-disk-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
4 changes: 0 additions & 4 deletions packages/frontend/src/Build.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,6 @@ $: {
>.
</p>
{/if}
<p class="text-gray-300 text-xs pt-1">
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.
</p>
</div>
<div>
<label for="path" class="block mb-2 text-sm font-bold text-gray-400">Build output folder</label>
Expand Down

0 comments on commit d4d767a

Please sign in to comment.