Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add buildkit install guide #377

Merged
merged 1 commit into from
Mar 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions content/guides/building-dockerfile-images-with-buildkit.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Building Dockerfile Images with Buildkit

description: |
This guide shows how to install buildkit to allow you to build Dockerfile images with Unikraft.
---

Unikraft uses [BuildKit](https://docs.docker.com/build/buildkit/), along with [Dockerfiles](https://docs.docker.com/reference/dockerfile/), to construct the root filesystem used by applications.
razvand marked this conversation as resolved.
Show resolved Hide resolved

You can install BuildKit by either running it natively via systemd or in a container.
Please refer to [BuildKit's installation instructions](https://github.com/moby/buildkit) for more information.

To use BuildKit with Docker on your system, you first need to install Docker following the [official instructions](https://docs.docker.com/engine/install/).
This can be either [Docker Engine](https://docs.docker.com/engine/) or [Docker Desktop](https://docs.docker.com/desktop/).

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

```bash
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:

```bash
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:

```bash
docker container ps | grep buildkit
```

You should see output similar to:

```bash
b146031cd4db moby/buildkit:latest "buildkitd" About a minute ago Up About a minute buildkit
```
Loading