百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

buildkit-nix

> DevOps
开源

使用 Dockerfile 进行 Nix 衍生(`Docker build -f default.nix`)。

189 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

使用 Dockerfile 进行 Nix 衍生(`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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Gobuildkitdockerfilenix

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类DevOps
定价开源

> 相关工具

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