Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
B

buildkit-nix

> DevOps
Open source

Nix derivations as Dockerfiles (`docker build -f default.nix .`)

189 stars0 likes2 views
WebsiteGitHub

About

Nix derivations as Dockerfiles (`docker build -f default.nix .`)

BuildKit-Nix: Nix as Dockerfiles (docker build -f default.nix .)

BuildKit-Nix allows using Nix derivations (default.nix, flake.nix) as Dockerfiles.

Examples

Legacy (with Niv):

  • ./examples/nginx/default.nix: Nginx

Flakes:

  • ./examples/nginx-flake/flake.nix: Nginx
  • ./examples/golang-httpserver-flake/flake.nix: A simple http server in Go
  • ./examples/rust-httpserver-flake/flake.nix: A simple http server in Rust

Usage

With Docker

Requires Docker 20.10 or later.

bash
cd examples/nginx
export DOCKER_BUILDKIT=1
docker build -t nginx-nix -f default.nix .
docker run -d -p 8080:80 --name nginx-nix nginx-nix

The digest of the contents of the image is reproducible:

bash
docker exec nginx-nix cat /.buildkit-nix/result.gunzipped.digest

Note: While the digest of the contents of the image is reproducible (as long as Nix can reproduce it), the digest of the image itself might not be always reproducible, due to potential non-determinism of gzip (and possibly other misc stuffs inside BuildKit).

With nerdctl

bash
cd examples/nginx
nerdctl build -t nginx-nix -f default.nix .

With buildctl

bash
cd examples/nginx
buildctl build --frontend dockerfile.v0 --local dockerfile=. --local context=. --opt filename=default.nix

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gobuildkitdockerfilenix

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理