TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published


atomist sdm goals npm version

Atomist software delivery machine (SDM) extension Pack for an Atomist SDM to integrate docker.

See the Atomist documentation for more information on what SDMs are and what they can do for you using the Atomist API for software.


Docker Image Creation


Dockerfile Parsing and Manipulation

This module includes support for parsing Docker files, within the Atomist tree path model. This allows us to query instructions in Docker files and update them without otherwise changing file content or formatting.

The following example returns the image name:

const images: string[] = await astUtils.findValues(p, DockerFileParser, "Dockerfile",

The following example uses DockerFileParser exported by this package, to update an image tag of argon, from node:argon to xenon to produce a file referencing node:xenon.

await astUtils.doWithAllMatches(p, DockerFileParser, "Dockerfile",
    n => n.$value = "xenon");

This example uses a custom function to find all RUN instructions that invoke rm:

const runs = await astUtils.findValues(p, DockerFileParser, "Dockerfile",
        removes: n => n.$value.includes("rm "),

We introduce the pair level to handle LABELs. For example, consider the following input:

LABEL "com.example.vendor"="ACME Incorporated"

The following code queries it:

const labelKeys = await astUtils.findValues(p, DockerFileParser, "Dockerfile",
assert.strictEqual(labelKeys[0], `com.example.vendor`);
const labelValues = await astUtils.findValues(p, DockerFileParser, "Dockerfile",
assert.strictEqual(labelValues[0], `ACME Incorporated`);
const knownKeys = await astUtils.findValues(p, DockerFileParser, "Dockerfile",
assert.strictEqual(knownKeys[0], `ACME Incorporated`);

Please see dockerFileParser.test.ts for further examples.


General support questions should be discussed in the #support channel in the Atomist community Slack workspace.

If you find a problem, please create an issue.


You will need to install Node to build and test this project.

Build and test

Use the following package scripts to build, test, and perform other development tasks.

Command Reason
npm install install project dependencies
npm run build compile, test, lint, and generate docs
npm run lint run TSLint against the TypeScript
npm run compile generate types from GraphQL and compile TypeScript
npm test run tests
npm run autotest run tests every time a file changes
npm run clean remove files generated during build


Releases are handled via the Atomist SDM. Just press the 'Approve' button in the Atomist dashboard or Slack.

Created by Atomist. Need Help? Join our Slack workspace.

Package Sidebar


npm i @atomist/sdm-pack-docker

Weekly Downloads






Unpacked Size

324 kB

Total Files


Last publish


  • neilprosser
  • atomist-bot
  • cdupuis
  • slimslenderslacks