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

dockflow

v1.0.8

Published

DockFlow is a Node.js script that streamlines Docker image operations, such as building, caching, and publishing. It's designed to simplify Docker image management, making it an invaluable tool for developers and DevOps engineers. DockFlow centralizes all

Downloads

30

Readme

DockFlow

Overview

DockFlow is a Node.js script that streamlines Docker image operations, such as building, caching, and publishing. It's designed to simplify Docker image management, making it an invaluable tool for developers and DevOps engineers. DockFlow centralizes all necessary information for Docker image publication in a single dockflow.json file, with the option to use details directly from package.json.

Features

  • Builds Docker images without needing to specify the image name.
  • Automatically tags images with the correct version.
  • Simple and clear command-line arguments for ease of use.
  • Facilitates easy publication of images to specified registries.
  • Enables the passing of build-specific details such as version as an environment variable to the Docker container.

Prerequisites

  • Node.js installed on your machine.
  • Access to a Docker environment.
  • Properly formatted dockflow.json and/or package.json files in your project directory.

dockflow.json Format

Ensure your dockflow.json file is properly configured. If certain parameters are not provided, the script defaults to values from package.json.

{
  "image": "<optional: defaults to package.json name>",
  "registry": "<optional> will publish the image on the public docker hub if not specified",
  "version": "<optional: defaults to package.json version>",
  "dockerfile": "<optional: defaults to 'Dockerfile'>"
}

Installation

Install DockFlow using npm:

npm install dockflow

Usage

Navigate to your project directory and run DockFlow commands using Node.js. The script recognizes the following commands:

npx dockflow build            // Build Docker image
npx dockflow publish          // Publish Docker image

Building Docker Images

To build a Docker image:

npx dockflow build

The image name is optional and defaults to the name specified in package.json. During the build, you can pass the version dynamically which will be available as an environment variable BUILD_VERSION inside the container:

docker build --build-arg BUILD_VERSION=$(require('../dockflow.json').version || 'latest') ...

To ensure the BUILD_VERSION environment variable is set inside your Docker container, your Dockerfile must include:

ARG BUILD_VERSION
ENV BUILD_VERSION=$BUILD_VERSION

Publishing Docker Images

To publish a Docker image:

npx dockflow publish

The script will use the registry and version details from dockflow.json, defaulting to package.json if not specified.

Additional Tips

When using the dockflow.json as a source for the image, you can display the version of the image directly in the service log for traceability:

console.log("Docker image version: " + (require('../dockflow.json').version || "latest"));

For the build task, you can add parameters, and it will append the image name automatically:

npx dockflow build --no-cache --progress=plain

to publish on npm

npm login npm publish