DocsReleasesCommunityGuidesBlog

Building Dockerfile Images with Buildkit

This guide shows how to install buildkit to allow you to build Dockerfile images with Unikraft.

Unikraft uses BuildKit, along with Dockerfiles, to construct the root filesystem used by applications.

You can install BuildKit by either running it natively via systemd or in a container. Please refer to BuildKit's installation instructions for more information.

To use BuildKit with Docker on your system, you first need to install Docker following the official instructions. This can be either Docker Engine or Docker Desktop.

After installing Docker, you can run BuildKit in a container via:

docker run -d --name buildkitd --privileged moby/buildkit:latest

Now instruct kraft to use the BuildKit instance from the buildkitd container by either setting the environmental variable:

export KRAFTKIT_BUILDKIT_HOST=docker-container://buildkitd

Or edit KraftKit's configuration file at ~/.config/kraftkit/config.yaml and set the buildkit_host attribute.

To check that it worked you can run the following command:

docker container ps | grep buildkit

You should see output similar to:

b146031cd4db moby/buildkit:latest "buildkitd" About a minute ago Up About a minute buildkit
Edit this page on GitHub

Connect with the community

Feel free to ask questions, report issues, and meet new people.

Join us on Discord!
®

Getting Started

What is a unikernel?Install CLI companion toolUnikraft InternalsRoadmap

© 2024  The Unikraft Authors. All rights reserved. Documentation distributed under CC BY-NC 4.0.