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

dockerflow

v0.1.7

Published

Smooth and simple Docker image development with Ansible.

Downloads

21

Readme

Dockerflow

Smooth and simple Docker image development with Ansible. Small configuration changes result in quick incremental updates of development images.

To build an image from scratch:

dockerflow build .

To rebuild the image incrementally after changing a playbook or file:

dockerflow rebuild .

To drop into a shell inside the container when the build fails so you can figure out what happened interactively:

dockerflow debug-build .

Why?

Existing Docker build systems don't support my preferred development workflow, which has four actions:

  • build: Build an image from a base image and a configuration spec.
  • rebuild: Make a change to the configuration spec; efficiently build an incremental update of the current build.
  • debug-build: Attempt to build an image from the base image and configuration spec, but drop into a shell inside the container on failure so I can identify the problem interactively.
  • debug-rebuild: Like debug-build, but with rebuild.

Why not Dockerfiles?

Dockerfiles are fine for 'build', but can be inefficient for 'rebuild'. Consider the following Dockerfile:

RUN apt-get install x y z
RUN long-running-source-build
...

If you remember that the subsequent steps also require apt-get install w, you can either add w to the existing apt-get install line, which means you have to wait for your long-running source build to finish again; or add a second apt-get install line further down, which gets confusing.

Also, I like Ansible's declarative approach to configuration better than Dockerfiles' imperative one.

If you also like Ansible but care about sticking with Dockerfiles more than 'rebuild', check this out.

Why not Packer?

I don't want the output to be complete tarballs of images, but tagged Docker images that I can push. Also, I want an easy incremental option.

Installation

Install Node.js, then sudo npm install -g dockerflow.

Usage

dockerflow action path [options], where action can be build, rebuild, debug-build or debug-rebuild.

In more or less the spirit of Dockerfiles, the given path should contain an Ansible playbook called 'dockerflow.yml' which specifies the configuration. In addition, the given path will be available inside the container read-only at /dockerflow during the build, but will not be bundled into the image.

The playbook should define the following variables:

  • dockerflow-base: The id or tag of the image from which the build should start.
  • dockerflow-tag: The tag that will be applied to the output image.
  • dockerflow-docker-options (optional): An arbitrary string of options to pass to the Docker client.
  • dockerflow-environment (optional): A space-separated list of environmental variables to forward into the container. You can access environmental from playbooks using this method or this method.
  • dockerflow-command: A command for the image to run automatically on startup.

Alternatively, these options can be set using command line options --base, --tag, --docker-options, --environment and --command. Command line options override config file options. Note that if you override --base, there is no difference between the build and rebuild actions.

If your Docker daemon is running on a nonstandard socket, you can pass the -H or --host argument.