0.7.3 • Published 15 days ago

buildahcker v0.7.3

Weekly downloads
-
License
MIT
Repository
github
Last release
15 days ago

Buildahcker

npm

Buildahcker is a node.js library to create and run commands in OCI (Open Container Initiative) container images (or docker images), based on Buildah and a hash-based cache. It also contains utilities to easily create a partitioned bootable disk image of a Linux system.

Have a look to the API documentation here.

Installation

npm install buildahcker --save-dev

Usage

Here is a basic sample:

import {
  defaultContainerCache,
  ImageBuilder,
  run,
  addFiles,
  MemFile,
  DiskLocation,
} from "buildahcker";

const createImage = async () => {
  const builder = await ImageBuilder.from("alpine:latest", {
    logger: process.stdout,
    containerCache: defaultContainerCache(),
  });
  await builder.executeStep([
    run(["apk", "add", "--no-cache", "nginx"]),
    addFiles({
      "etc/issue": new MemFile({
        content: "Hello",
      }),
      app: new DiskLocation("./app", {
        overrideAttributes: { uid: 1, gid: 2 },
      }),
    }),
  ]);
  console.log("Created image: ", builder.imageId);
};

createImage();

Check the tests and this sample repository for more usage examples.

0.7.2

15 days ago

0.7.3

15 days ago

0.7.1

15 days ago

0.7.0

15 days ago

0.6.2

22 days ago

0.6.1

23 days ago

0.6.0

23 days ago

0.5.0

26 days ago

0.4.1

1 month ago

0.4.0

1 month ago

0.3.0

1 month ago

0.2.0

1 month ago

0.0.2

1 month ago

0.1.0

2 months ago