npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

buildctl

v0.22.0-5

Published

CLI for BuildKit, a toolkit for converting source code to build artifacts

Downloads

37

Readme

buildctl with docker build syntax

You have three types of container image builds:

  • Language-specific like ko and jib.
  • Add files to a base image. Lots of tools can do that locally as layers are just tarballs. Use for example contain.
  • One that needs to run commands in the base image. For that use buildkit.

In the latter case, buildkit's client CLI buildctl is great because it doesn't depend on any docker-ish platform.

While BuildKit is a generic DAG runner we only ever care about it's ability to process Dockerfiles.

npm package

This repo publishes the NPM package buildctl that redistributes the client binary from BuildKit releases.

BuildKit is a toolkit for converting source code to build artifacts in an efficient, expressive and repeatable manner. buildctl is its command-line interface.

Installation

npm install buildctl

Or globally:

npm install -g buildctl

Usage

After installation, the buildctl command will be available:

buildctl --help

buildctl-dockerfile Command

This package also provides a buildctl-dockerfile command (aliased as buildctl-d) that offers a simplified interface similar to docker build for common Dockerfile-based builds:

buildctl-dockerfile [OPTIONS] CONTEXT

Options:

  • -f, --file DOCKERFILE - Path to the Dockerfile (default: Dockerfile in context)
  • --build-arg KEY=VALUE - Set build arguments
  • -t, --tag IMAGE - Name and optionally tag for the built image
  • --push - Push the image to registry (requires -t/--tag or --output in passthrough)
  • --dry-run - Print the buildctl command that would be executed
  • -- - Pass remaining arguments directly to buildctl

Examples:

# Build with default Dockerfile in current directory
buildctl-dockerfile .

# Build with custom Dockerfile
buildctl-dockerfile -f custom.Dockerfile .

# Build with build arguments
buildctl-dockerfile --build-arg NODE_VERSION=18 --build-arg ENV=production .

# Build and tag the image
buildctl-dockerfile -t myapp:latest .

# Build, tag and push the image
buildctl-dockerfile -t myregistry.com/myapp:latest --push .

# See what buildctl command would be executed (dry run)
buildctl-dockerfile --dry-run .

# Combine options
buildctl-dockerfile -f docker/Dockerfile -t myapp:v1.0 --build-arg VERSION=1.0 ./src

# Pass additional buildctl options
buildctl-dockerfile . -- --progress=plain --no-cache --export-cache type=local,dest=/tmp/cache

# Override output destination (ignores -t flag if specified)
buildctl-dockerfile -t ignored:tag . -- --output type=registry,name=myregistry.com/image:latest,push=true

Note: If --output is provided in passthrough arguments (after --), it will override any output configuration from the -t/--tag option. The command validates for conflicting options:

  • Cannot use both -t/--tag and name= in passthrough --output
  • Cannot use both --push and push= in passthrough --output
  • --push requires either -t/--tag or --output in passthrough arguments

The command translates these familiar options into the appropriate buildctl build syntax with the dockerfile frontend.

Supported Platforms

This package automatically installs the correct binary for your platform:

  • macOS: arm64, amd64
  • Linux: amd64, arm64, arm-v7, ppc64le, riscv64, s390x
  • Windows: amd64, arm64

How it works

This package uses optional dependencies to install platform-specific packages containing the buildctl binary for your system. The main package serves as a wrapper that selects the appropriate binary.

Platform-specific packages follow the naming pattern: buildctl-{os}-{arch}

Versioning

Package versions correspond to BuildKit releases. For example, version 0.22.0 contains buildctl from BuildKit v0.22.0.

License

This package is licensed under Apache-2.0, same as BuildKit.

The buildctl binary is built and distributed by the BuildKit project: https://github.com/moby/buildkit

Testing

To run the regression test suite for the buildctl-dockerfile command:

./test-dockerfile.sh

See TESTS.md for detailed test documentation and manual test cases.