unikraft / kraftkit

Build and use highly customized and ultra-lightweight unikernel VMs.
https://unikraft.org/docs/cli
BSD 3-Clause "New" or "Revised" License
224 stars 64 forks source link

Detect host BuildKit or host container system and aid in setting up BuildKit during install #1090

Closed nderjung closed 2 months ago

nderjung commented 9 months ago

Feature request summary

During the installation process of kraftkit, that is, via the recommended installer method, the script should aid the user with setting up BuildKit. This will become increasingly necessary for users who wish to use the pre-built base runtime.

BuildKit can be run in several different ways and the setup script should accommodate for these different ways. First, on a Linux system, the unix socket path /run/buildkit/buildkitd.sock should be detected. If it is detected and is read-writable by the user, it should be added to the user's config under buildkit_host. The user should be prompted before this occurs with something similar to:

Detected BuildKit socket at '/run/buildkit/buildkitd.sock'
Would you like to let KraftKit use this for building Dockerfiles? [Yn]

If BuildKit cannot be detected at the unix socket path location, or the system is macOS/Darwin, or other, then detect if a container runtime exists from a choice of container/nerdctl, docker and podman. These three container runtimes are supported by KraftKit. If any these are detected, a question as to whether instantiating buildkit as a privileged container should be prompted with affirmation the following should be invoked:

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

The name buildkitd can be used as the buildkit_host, e.g.:

docker-container://buildkitd

See BuildKit's README for more information.

Describe alternatives

No response

Related architectures

None

Related platforms

None

Additional context

No response

craciunoiuc commented 2 months ago

Ancient and done