{"id":15929356,"url":"https://github.com/crazy-max/buildkit-nofrontend","last_synced_at":"2025-08-22T18:32:00.642Z","repository":{"id":44899471,"uuid":"448517430","full_name":"crazy-max/buildkit-nofrontend","owner":"crazy-max","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-19T21:10:46.000Z","size":22389,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-18T07:31:57.386Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crazy-max.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-16T10:08:37.000Z","updated_at":"2024-10-06T07:58:07.000Z","dependencies_parsed_at":"2022-09-16T03:41:11.359Z","dependency_job_id":null,"html_url":"https://github.com/crazy-max/buildkit-nofrontend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fbuildkit-nofrontend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fbuildkit-nofrontend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fbuildkit-nofrontend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crazy-max%2Fbuildkit-nofrontend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crazy-max","download_url":"https://codeload.github.com/crazy-max/buildkit-nofrontend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230626683,"owners_count":18255684,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-07T00:03:33.965Z","updated_at":"2024-12-20T17:55:58.017Z","avatar_url":"https://github.com/crazy-max.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![asciicinema example](https://asciinema.org/a/gPEIEo1NzmDTUu2bEPsUboqmU.png)](https://asciinema.org/a/gPEIEo1NzmDTUu2bEPsUboqmU)\n\n# BuildKit\n\n[![GoDoc](https://godoc.org/github.com/moby/buildkit?status.svg)](https://godoc.org/github.com/moby/buildkit/client/llb)\n[![Build Status](https://github.com/moby/buildkit/workflows/build/badge.svg)](https://github.com/moby/buildkit/actions?query=workflow%3Abuild)\n[![Go Report Card](https://goreportcard.com/badge/github.com/moby/buildkit)](https://goreportcard.com/report/github.com/moby/buildkit)\n[![codecov](https://codecov.io/gh/moby/buildkit/branch/master/graph/badge.svg)](https://codecov.io/gh/moby/buildkit)\n\nBuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner.\n\nKey features:\n\n-   Automatic garbage collection\n-   Extendable frontend formats\n-   Concurrent dependency resolution\n-   Efficient instruction caching\n-   Build cache import/export\n-   Nested build job invocations\n-   Distributable workers\n-   Multiple output formats\n-   Pluggable architecture\n-   Execution without root privileges\n\nRead the proposal from https://github.com/moby/moby/issues/32925\n\nIntroductory blog post https://blog.mobyproject.org/introducing-buildkit-17e056cc5317\n\nJoin `#buildkit` channel on [Docker Community Slack](http://dockr.ly/slack)\n\n:information_source: If you are visiting this repo for the usage of BuildKit-only Dockerfile features like `RUN --mount=type=(bind|cache|tmpfs|secret|ssh)`,\nplease refer to [`docker/dockerfile`](https://github.com/docker/dockerfile) repository.\n\n:information_source: [BuildKit has been integrated to `docker build` since Docker 18.06 .](https://docs.docker.com/develop/develop-images/build_enhancements/)\nYou don't need to read this document unless you want to use the full-featured standalone version of BuildKit.\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n\n- [Used by](#used-by)\n- [Quick start](#quick-start)\n  - [Starting the `buildkitd` daemon:](#starting-the-buildkitd-daemon)\n  - [Exploring LLB](#exploring-llb)\n  - [Exploring Dockerfiles](#exploring-dockerfiles)\n    - [Building a Dockerfile with `buildctl`](#building-a-dockerfile-with-buildctl)\n    - [Building a Dockerfile using external frontend](#building-a-dockerfile-using-external-frontend)\n    - [Building a Dockerfile with experimental features like `RUN --mount=type=(bind|cache|tmpfs|secret|ssh)`](#building-a-dockerfile-with-experimental-features-like-run---mounttypebindcachetmpfssecretssh)\n  - [Output](#output)\n    - [Image/Registry](#imageregistry)\n    - [Local directory](#local-directory)\n    - [Docker tarball](#docker-tarball)\n    - [OCI tarball](#oci-tarball)\n    - [containerd image store](#containerd-image-store)\n- [Cache](#cache)\n  - [Garbage collection](#garbage-collection)\n  - [Export cache](#export-cache)\n    - [Inline (push image and cache together)](#inline-push-image-and-cache-together)\n    - [Registry (push image and cache separately)](#registry-push-image-and-cache-separately)\n    - [Local directory](#local-directory-1)\n    - [GitHub Actions cache (experimental)](#github-actions-cache-experimental)\n  - [Consistent hashing](#consistent-hashing)\n- [Metadata](#metadata)\n- [Systemd socket activation](#systemd-socket-activation)\n- [Expose BuildKit as a TCP service](#expose-buildkit-as-a-tcp-service)\n  - [Load balancing](#load-balancing)\n- [Containerizing BuildKit](#containerizing-buildkit)\n  - [Podman](#podman)\n  - [Kubernetes](#kubernetes)\n  - [Daemonless](#daemonless)\n- [Opentracing support](#opentracing-support)\n- [Running BuildKit without root privileges](#running-buildkit-without-root-privileges)\n- [Building multi-platform images](#building-multi-platform-images)\n- [Contributing](#contributing)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Used by\n\nBuildKit is used by the following projects:\n\n-   [Moby \u0026 Docker](https://github.com/moby/moby/pull/37151) (`DOCKER_BUILDKIT=1 docker build`)\n-   [img](https://github.com/genuinetools/img)\n-   [OpenFaaS Cloud](https://github.com/openfaas/openfaas-cloud)\n-   [container build interface](https://github.com/containerbuilding/cbi)\n-   [Tekton Pipelines](https://github.com/tektoncd/catalog) (formerly [Knative Build Templates](https://github.com/knative/build-templates))\n-   [the Sanic build tool](https://github.com/distributed-containers-inc/sanic)\n-   [vab](https://github.com/stellarproject/vab)\n-   [Rio](https://github.com/rancher/rio)\n-   [kim](https://github.com/rancher/kim)\n-   [PouchContainer](https://github.com/alibaba/pouch)\n-   [Docker buildx](https://github.com/docker/buildx)\n-   [Okteto Cloud](https://okteto.com/)\n-   [Earthly earthfiles](https://github.com/vladaionescu/earthly)\n-   [Gitpod](https://github.com/gitpod-io/gitpod)\n\n## Quick start\n\n:information_source: For Kubernetes deployments, see [`examples/kubernetes`](./examples/kubernetes).\n\nBuildKit is composed of the `buildkitd` daemon and the `buildctl` client.\nWhile the `buildctl` client is available for Linux, macOS, and Windows, the `buildkitd` daemon is only available for Linux currently.\n\nThe `buildkitd` daemon requires the following components to be installed:\n-   [runc](https://github.com/opencontainers/runc) or [crun](https://github.com/containers/crun)\n-   [containerd](https://github.com/containerd/containerd) (if you want to use containerd worker)\n\nThe latest binaries of BuildKit are available [here](https://github.com/moby/buildkit/releases) for Linux, macOS, and Windows.\n\n[Homebrew package](https://formulae.brew.sh/formula/buildkit) (unofficial) is available for macOS.\n```console\n$ brew install buildkit\n```\n\nTo build BuildKit from source, see [`.github/CONTRIBUTING.md`](./.github/CONTRIBUTING.md).\n\n### Starting the `buildkitd` daemon:\n\nYou need to run `buildkitd` as the root user on the host.\n\n```bash\n$ sudo buildkitd\n```\n\nTo run `buildkitd` as a non-root user, see [`docs/rootless.md`](docs/rootless.md).\n\nThe buildkitd daemon supports two worker backends: OCI (runc) and containerd.\n\nBy default, the OCI (runc) worker is used. You can set `--oci-worker=false --containerd-worker=true` to use the containerd worker.\n\nWe are open to adding more backends.\n\nTo start the buildkitd daemon using systemd socket activiation, you can install the buildkit systemd unit files.\nSee [Systemd socket activation](#systemd-socket-activation)\n\nThe buildkitd daemon listens gRPC API on `/run/buildkit/buildkitd.sock` by default, but you can also use TCP sockets.\nSee [Expose BuildKit as a TCP service](#expose-buildkit-as-a-tcp-service).\n\n### Exploring LLB\n\nBuildKit builds are based on a binary intermediate format called LLB that is used for defining the dependency graph for processes running part of your build. tl;dr: LLB is to Dockerfile what LLVM IR is to C.\n\n-   Marshaled as Protobuf messages\n-   Concurrently executable\n-   Efficiently cacheable\n-   Vendor-neutral (i.e. non-Dockerfile languages can be easily implemented)\n\nSee [`solver/pb/ops.proto`](./solver/pb/ops.proto) for the format definition, and see [`./examples/README.md`](./examples/README.md) for example LLB applications.\n\nCurrently, the following high-level languages has been implemented for LLB:\n\n-   Dockerfile (See [Exploring Dockerfiles](#exploring-dockerfiles))\n-   [Buildpacks](https://github.com/tonistiigi/buildkit-pack)\n-   [Mockerfile](https://matt-rickard.com/building-a-new-dockerfile-frontend/)\n-   [Gockerfile](https://github.com/po3rin/gockerfile)\n-   [bldr (Pkgfile)](https://github.com/talos-systems/bldr/)\n-   [HLB](https://github.com/openllb/hlb)\n-   [Earthfile (Earthly)](https://github.com/earthly/earthly)\n-   [Cargo Wharf (Rust)](https://github.com/denzp/cargo-wharf)\n-   [Nix](https://github.com/AkihiroSuda/buildkit-nix)\n-   (open a PR to add your own language)\n\n### Exploring Dockerfiles\n\nFrontends are components that run inside BuildKit and convert any build definition to LLB. There is a special frontend called gateway (`gateway.v0`) that allows using any image as a frontend.\n\nDuring development, Dockerfile frontend (`dockerfile.v0`) is also part of the BuildKit repo. In the future, this will be moved out, and Dockerfiles can be built using an external image.\n\n#### Building a Dockerfile with `buildctl`\n\n```bash\nbuildctl build \\\n    --frontend=dockerfile.v0 \\\n    --local context=. \\\n    --local dockerfile=.\n# or\nbuildctl build \\\n    --frontend=dockerfile.v0 \\\n    --local context=. \\\n    --local dockerfile=. \\\n    --opt target=foo \\\n    --opt build-arg:foo=bar\n```\n\n`--local` exposes local source files from client to the builder. `context` and `dockerfile` are the names Dockerfile frontend looks for build context and Dockerfile location.\n\n#### Building a Dockerfile using external frontend:\n\nExternal versions of the Dockerfile frontend are pushed to https://hub.docker.com/r/docker/dockerfile\nand can be used with the gateway frontend. The source for the external frontend\nis currently located in [`docker/dockerfile`](https://github.com/docker/dockerfile) repository.\n\n```bash\nbuildctl build \\\n    --frontend gateway.v0 \\\n    --opt source=docker/dockerfile \\\n    --local context=. \\\n    --local dockerfile=.\nbuildctl build \\\n    --frontend gateway.v0 \\\n    --opt source=docker/dockerfile \\\n    --opt context=https://github.com/moby/moby.git \\\n    --opt build-arg:APT_MIRROR=cdn-fastly.deb.debian.org\n```\n\n#### Building a Dockerfile with experimental features like `RUN --mount=type=(bind|cache|tmpfs|secret|ssh)`\n\nSee [`docker/dockerfile`](https://github.com/docker/dockerfile) repository.\n\n### Output\n\nBy default, the build result and intermediate cache will only remain internally in BuildKit. An output needs to be specified to retrieve the result.\n\n#### Image/Registry\n\n```bash\nbuildctl build ... --output type=image,name=docker.io/username/image,push=true\n```\n\nTo export the cache embed with the image and pushing them to registry together, type `registry` is required to import the cache, you should specify `--export-cache type=inline` and `--import-cache type=registry,ref=...`. To export the cache to a local directy, you should specify `--export-cache type=local`.\nDetails in [Export cache](#export-cache).\n\n```bash\nbuildctl build ...\\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=inline \\\n  --import-cache type=registry,ref=docker.io/username/image\n```\n\nKeys supported by image output:\n* `name=[value]`: image name\n* `push=true`: push after creating the image\n* `push-by-digest=true`: push unnamed image\n* `registry.insecure=true`: push to insecure HTTP registry\n* `oci-mediatypes=true`: use OCI mediatypes in configuration JSON instead of Docker's\n* `unpack=true`: unpack image after creation (for use with containerd)\n* `dangling-name-prefix=[value]`: name image with `prefix@\u003cdigest\u003e` , used for anonymous images\n* `name-canonical=true`: add additional canonical name `name@\u003cdigest\u003e`\n* `compression=[uncompressed,gzip,estargz,zstd]`: choose compression type for layers newly created and cached, gzip is default value. estargz should be used with `oci-mediatypes=true`.\n* `force-compression=true`: forcefully apply `compression` option to all layers (including already existing layers).\n* `buildinfo=[all,imageconfig,metadata,none]`: choose [build dependency](docs/build-repro.md#build-dependencies) version to export (default `all`).\n\nIf credentials are required, `buildctl` will attempt to read Docker configuration file `$DOCKER_CONFIG/config.json`.\n`$DOCKER_CONFIG` defaults to `~/.docker`.\n\n#### Local directory\n\nThe local client will copy the files directly to the client. This is useful if BuildKit is being used for building something else than container images.\n\n```bash\nbuildctl build ... --output type=local,dest=path/to/output-dir\n```\n\nTo export specific files use multi-stage builds with a scratch stage and copy the needed files into that stage with `COPY --from`.\n\n```dockerfile\n...\nFROM scratch as testresult\n\nCOPY --from=builder /usr/src/app/testresult.xml .\n...\n```\n\n```bash\nbuildctl build ... --opt target=testresult --output type=local,dest=path/to/output-dir\n```\n\nTar exporter is similar to local exporter but transfers the files through a tarball.\n\n```bash\nbuildctl build ... --output type=tar,dest=out.tar\nbuildctl build ... --output type=tar \u003e out.tar\n```\n\n#### Docker tarball\n\n```bash\n# exported tarball is also compatible with OCI spec\nbuildctl build ... --output type=docker,name=myimage | docker load\n```\n\n#### OCI tarball\n\n```bash\nbuildctl build ... --output type=oci,dest=path/to/output.tar\nbuildctl build ... --output type=oci \u003e output.tar\n```\n#### containerd image store\n\nThe containerd worker needs to be used\n\n```bash\nbuildctl build ... --output type=image,name=docker.io/username/image\nctr --namespace=buildkit images ls\n```\n\nTo change the containerd namespace, you need to change `worker.containerd.namespace` in [`/etc/buildkit/buildkitd.toml`](./docs/buildkitd.toml.md).\n\n\n## Cache\n\nTo show local build cache (`/var/lib/buildkit`):\n\n```bash\nbuildctl du -v\n```\n\nTo prune local build cache:\n```bash\nbuildctl prune\n```\n\n### Garbage collection\n\nSee [`./docs/buildkitd.toml.md`](./docs/buildkitd.toml.md).\n\n### Export cache\n\nBuildKit supports the following cache exporters:\n* `inline`: embed the cache into the image, and push them to the registry together\n* `registry`: push the image and the cache separately\n* `local`: export to a local directory\n* `gha`: export to GitHub Actions cache\n\nIn most case you want to use the `inline` cache exporter.\nHowever, note that the `inline` cache exporter only supports `min` cache mode. \nTo enable `max` cache mode, push the image and the cache separately by using `registry` cache exporter.\n\n`inline` and `registry` exporters both store the cache in the registry. For importing the cache, `type=registry` is sufficient for both, as specifying the cache format is not necessary.\n\n#### Inline (push image and cache together)\n\n```bash\nbuildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=inline \\\n  --import-cache type=registry,ref=docker.io/username/image\n```\n\nNote that the inline cache is not imported unless [`--import-cache type=registry,ref=...`](#registry-push-image-and-cache-separately) is provided.\n\nInline cache embeds cache metadata into the image config. The layers in the image will be left untouched compared to the image with no cache information.\n\n:information_source: Docker-integrated BuildKit (`DOCKER_BUILDKIT=1 docker build`) and `docker buildx`requires \n`--build-arg BUILDKIT_INLINE_CACHE=1` to be specified to enable the `inline` cache exporter.\nHowever, the standalone `buildctl` does NOT require `--opt build-arg:BUILDKIT_INLINE_CACHE=1` and the build-arg is simply ignored.\n\n#### Registry (push image and cache separately)\n\n```bash\nbuildctl build ... \\\n  --output type=image,name=localhost:5000/myrepo:image,push=true \\\n  --export-cache type=registry,ref=localhost:5000/myrepo:buildcache \\\n  --import-cache type=registry,ref=localhost:5000/myrepo:buildcache\n```\n\n`--export-cache` options:\n* `type=registry`\n* `mode=min` (default): only export layers for the resulting image\n* `mode=max`: export all the layers of all intermediate steps.\n* `ref=docker.io/user/image:tag`: reference\n* `oci-mediatypes=true|false`: whether to use OCI mediatypes in exported manifests. Since BuildKit `v0.8` defaults to true.\n\n`--import-cache` options:\n* `type=registry`\n* `ref=docker.io/user/image:tag`: reference\n\n#### Local directory\n\n```bash\nbuildctl build ... --export-cache type=local,dest=path/to/output-dir\nbuildctl build ... --import-cache type=local,src=path/to/input-dir\n```\n\nThe directory layout conforms to OCI Image Spec v1.0.\n\n`--export-cache` options:\n* `type=local`\n* `mode=min` (default): only export layers for the resulting image\n* `mode=max`: export all the layers of all intermediate steps.\n* `dest=path/to/output-dir`: destination directory for cache exporter\n* `oci-mediatypes=true|false`: whether to use OCI mediatypes in exported manifests. Since BuildKit `v0.8` defaults to true.\n\n`--import-cache` options:\n* `type=local`\n* `src=path/to/input-dir`: source directory for cache importer\n* `digest=sha256:deadbeef`: digest of the manifest list to import.\n* `tag=customtag`: custom tag of image. Defaults \"latest\" tag digest in `index.json` is for digest, not for tag\n\n#### GitHub Actions cache (experimental)\n\n```bash\nbuildctl build ... \\\n  --output type=image,name=docker.io/username/image,push=true \\\n  --export-cache type=gha \\\n  --import-cache type=gha\n```\n\nGithub Actions cache saves both cache metadata and layers to GitHub's Cache service. This cache currently has a [size limit of 10GB](https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy) that is shared accross different caches in the repo. If you exceed this limit, GitHub will save your cache but will begin evicting caches until the total size is less than 10 GB. Recycling caches too often can result in slower runtimes overall.\n\nSimilarly to using [actions/cache](https://github.com/actions/cache), caches are [scoped by branch](https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache), with the default and target branches being available to every branch.\n\nFollowing attributes are required to authenticate against the [Github Actions Cache service API](https://github.com/tonistiigi/go-actions-cache/blob/master/api.md#authentication):\n* `url`: Cache server URL (default `$ACTIONS_CACHE_URL`)\n* `token`: Access token (default `$ACTIONS_RUNTIME_TOKEN`)\n\n:information_source: This type of cache can be used with [Docker Build Push Action](https://github.com/docker/build-push-action)\nwhere `url` and `token` will be automatically set. To use this backend in a inline `run` step, you have to include [crazy-max/ghaction-github-runtime](https://github.com/crazy-max/ghaction-github-runtime)\nin your workflow to expose the runtime.\n\n`--export-cache` options:\n* `type=gha`\n* `mode=min` (default): only export layers for the resulting image\n* `mode=max`: export all the layers of all intermediate steps.\n* `scope=buildkit`: which scope cache object belongs to (default `buildkit`)\n\n`--import-cache` options:\n* `type=gha`\n* `scope=buildkit`: which scope cache object belongs to (default `buildkit`)\n\n### Consistent hashing\n\nIf you have multiple BuildKit daemon instances but you don't want to use registry for sharing cache across the cluster,\nconsider client-side load balancing using consistent hashing.\n\nSee [`./examples/kubernetes/consistenthash`](./examples/kubernetes/consistenthash).\n\n## Metadata\n\nTo output build metadata such as the image digest, pass the `--metadata-file` flag.\nThe metadata will be written as a JSON object to the specified file.\nThe directory of the specified file must already exist and be writable.\n\n```bash\nbuildctl build ... --metadata-file metadata.json\n```\n\n```\n{\"containerimage.digest\": \"sha256:ea0cfb27fd41ea0405d3095880c1efa45710f5bcdddb7d7d5a7317ad4825ae14\",...}\n```\n\n## Systemd socket activation\n\nOn Systemd based systems, you can communicate with the daemon via [Systemd socket activation](http://0pointer.de/blog/projects/socket-activation.html), use `buildkitd --addr fd://`.\nYou can find examples of using Systemd socket activation with BuildKit and Systemd in [`./examples/systemd`](./examples/systemd).\n## Expose BuildKit as a TCP service\n\nThe `buildkitd` daemon can listen the gRPC API on a TCP socket.\n\nIt is highly recommended to create TLS certificates for both the daemon and the client (mTLS).\nEnabling TCP without mTLS is dangerous because the executor containers (aka Dockerfile `RUN` containers) can call BuildKit API as well.\n\n```bash\nbuildkitd \\\n  --addr tcp://0.0.0.0:1234 \\\n  --tlscacert /path/to/ca.pem \\\n  --tlscert /path/to/cert.pem \\\n  --tlskey /path/to/key.pem\n```\n\n```bash\nbuildctl \\\n  --addr tcp://example.com:1234 \\\n  --tlscacert /path/to/ca.pem \\\n  --tlscert /path/to/clientcert.pem \\\n  --tlskey /path/to/clientkey.pem \\\n  build ...\n```\n\n### Load balancing\n\n`buildctl build` can be called against randomly load balanced the `buildkitd` daemon.\n\nSee also [Consistent hashing](#consistenthashing) for client-side load balancing.\n\n## Containerizing BuildKit\n\nBuildKit can also be used by running the `buildkitd` daemon inside a Docker container and accessing it remotely.\n\nWe provide the container images as [`moby/buildkit`](https://hub.docker.com/r/moby/buildkit/tags/):\n\n-   `moby/buildkit:latest`: built from the latest regular [release](https://github.com/moby/buildkit/releases)\n-   `moby/buildkit:rootless`: same as `latest` but runs as an unprivileged user, see [`docs/rootless.md`](docs/rootless.md)\n-   `moby/buildkit:master`: built from the master branch\n-   `moby/buildkit:master-rootless`: same as master but runs as an unprivileged user, see [`docs/rootless.md`](docs/rootless.md)\n\nTo run daemon in a container:\n\n```bash\ndocker run -d --name buildkitd --privileged moby/buildkit:latest\nexport BUILDKIT_HOST=docker-container://buildkitd\nbuildctl build --help\n```\n\n### Podman\nTo connect to a BuildKit daemon running in a Podman container, use `podman-container://` instead of `docker-container://` .\n\n```bash\npodman run -d --name buildkitd --privileged moby/buildkit:latest\nbuildctl --addr=podman-container://buildkitd build --frontend dockerfile.v0 --local context=. --local dockerfile=. --output type=oci | podman load foo\n```\n\n`sudo` is not required.\n\n### Kubernetes\n\nFor Kubernetes deployments, see [`examples/kubernetes`](./examples/kubernetes).\n\n### Daemonless\n\nTo run the client and an ephemeral daemon in a single container (\"daemonless mode\"):\n\n```bash\ndocker run \\\n    -it \\\n    --rm \\\n    --privileged \\\n    -v /path/to/dir:/tmp/work \\\n    --entrypoint buildctl-daemonless.sh \\\n    moby/buildkit:master \\\n        build \\\n        --frontend dockerfile.v0 \\\n        --local context=/tmp/work \\\n        --local dockerfile=/tmp/work\n```\n\nor\n\n```bash\ndocker run \\\n    -it \\\n    --rm \\\n    --security-opt seccomp=unconfined \\\n    --security-opt apparmor=unconfined \\\n    -e BUILDKITD_FLAGS=--oci-worker-no-process-sandbox \\\n    -v /path/to/dir:/tmp/work \\\n    --entrypoint buildctl-daemonless.sh \\\n    moby/buildkit:master-rootless \\\n        build \\\n        --frontend \\\n        dockerfile.v0 \\\n        --local context=/tmp/work \\\n        --local dockerfile=/tmp/work\n```\n\n## Opentracing support\n\nBuildKit supports opentracing for buildkitd gRPC API and buildctl commands. To capture the trace to [Jaeger](https://github.com/jaegertracing/jaeger), set `JAEGER_TRACE` environment variable to the collection address.\n\n```bash\ndocker run -d -p6831:6831/udp -p16686:16686 jaegertracing/all-in-one:latest\nexport JAEGER_TRACE=0.0.0.0:6831\n# restart buildkitd and buildctl so they know JAEGER_TRACE\n# any buildctl command should be traced to http://127.0.0.1:16686/\n```\n\n## Running BuildKit without root privileges\n\nPlease refer to [`docs/rootless.md`](docs/rootless.md).\n\n## Building multi-platform images\n\nPlease refer to [`docs/multi-platform.md`](docs/multi-platform.md).\n\n## Contributing\n\nWant to contribute to BuildKit? Awesome! You can find information about contributing to this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fbuildkit-nofrontend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrazy-max%2Fbuildkit-nofrontend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrazy-max%2Fbuildkit-nofrontend/lists"}