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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jielu/pulumi-docker-buildkit

v0.1.17

Published

A Pulumi provider that builds and pushes a Docker image to a registry using Buildkit.

Downloads

3

Readme

Docker Buildkit Pulumi Provider

A Pulumi provider that builds and pushes a Docker image to a registry using Buildkit.

Motivation

Why use this provider over the official pulumi-docker provider? This provider fixes many of the bugs with the official Docker provider:

  • pulumi preview does not silently block while waiting for the Docker image to build.
  • Output from docker build streams to the terminal during pulumi up.
  • docker build is not invoked if nothing in the build context has changed.
  • Changes to the build context cause a diff to appear during pulumi preview.

It also provides several new features:

  • Support for cross-building images (e.g., building a linux/arm64 image on a linux/amd64 host.)
  • Automatic inline caching.

There are a few limitations though. The Image resource is much less configurable than the Image resource in the official Docker provider. And there is no support whatsoever for the other resource types, like Container or Secret.

Usage example

To build and push an image to an AWS ECR repository:

import base64

import pulumi
import pulumi_aws as aws
import pulumi_docker_buildkit as docker_buildkit

def get_registry_info(registry_id):
    credentials = aws.ecr.get_credentials(registry_id)
    username, password = base64.b64decode(credentials.authorization_token).decode().split(":")
    return docker_buildkit.RegistryArgs(
        server=credentials.proxy_endpoint,
        username=username,
        password=password,
    )


repo = aws.ecr.Repository("repo")
image = docker_buildkit.Image(
    "image",
    name=repo.repository_url,
    registry=repo.registry_id.apply(get_registry_info),
)

Warning: Be sure to aggressively exclude files in your .dockerignore. The Image resource hashes all files in the build context before determining whether to invoke docker build. This is fast, unless you have tens of thousands of files in your build context. The .git directory and node_modules are the usual culprits.

Future plans

I plan to make minor bugfixes as necessary for our use of this provider at @MaterializeInc. I do not currently plan to bring it to feature parity with the official Docker provider, nor do I have the time to entertain such contributions. Sorry! I encourage you to either fork this repository or to use the ideas here to improve the official Pulumi Docker provider.