A custom image for CI pipelines to sign in to Postman and run a collection.
Based on the currently supported stable Node.js slim images (node).
Features:
postman)This Dockerfile is built with a GitHub Workflow. A dispatched run publishes linux/amd64 and linux/arm64 images for each Node.js tag to Docker Hub and GitHub Container Registry.
Use ghcr.io/rechtlogisch/postman or rechtlogisch/postman. Tags follow the Node.js major versions, plus lts.
POSTMAN_COLLECTION is required. Set POSTMAN_API_KEY for a collection in the Postman cloud. A collection file on disk can run without a key. With the image defaults, the entrypoint logs in when a key is present and runs:
postman collection run "$POSTMAN_COLLECTION" --reporters cli,junit --reporter-junit-export /reports/report.xml
A local collection file skips login when POSTMAN_API_KEY is unset:
docker run --rm \
-e POSTMAN_COLLECTION=/work/collection.json \
-v "$PWD:/work" \
ghcr.io/rechtlogisch/postman:lts
Mount a host directory on /reports to keep the JUnit file.
docker run --rm \
-e POSTMAN_API_KEY \
-e POSTMAN_COLLECTION=12345678-1234-1234-1234-123456789012 \
-v "$PWD/reports:/reports" \
ghcr.io/rechtlogisch/postman:lts
Words after the image name are appended to postman collection run. Use them for an environment, a data file, --bail, or any other CLI flag:
docker run --rm \
-e POSTMAN_API_KEY \
-e POSTMAN_COLLECTION \
ghcr.io/rechtlogisch/postman:lts \
-e staging \
--bail
POSTMAN_FOLDERS is a comma-separated list. Each entry becomes one -i (folder name, path, or id).
docker run --rm \
-e POSTMAN_API_KEY \
-e POSTMAN_COLLECTION \
-e POSTMAN_FOLDERS="Auth,Checkout" \
ghcr.io/rechtlogisch/postman:lts
scripts/run-local clears the entrypoint and runs one command in the container:
scripts/run-local "postman --version"
Tip
You can provide an explicit `IMAGE_TAG` on runtime.
| Variable | Required | Default | Effect |
|---|---|---|---|
POSTMAN_COLLECTION | yes | Collection id or path inside the container. The run exits when this is empty. | |
POSTMAN_API_KEY | Signs in with postman login --with-api-key before the run. Leave unset for a local collection that needs no login. | ||
POSTMAN_REGION | Passed as postman login --region. Applied only when POSTMAN_API_KEY is set. | ||
POSTMAN_FOLDERS | Comma-separated folder names, paths, or ids. Each value is one -i. Surrounding spaces are ignored. | ||
POSTMAN_REPORTERS | cli,junit | Comma-separated reporters: cli, json, junit, html. | |
POSTMAN_REPORT_DIR | /reports | Directory for the json, junit, and html files. An empty value skips the export flags and leaves the CLI default ./postman-cli-reports. | |
POSTMAN_REPORT_BASENAME | report | File name without an extension. An empty value lets the CLI name the files inside POSTMAN_REPORT_DIR. | |
POSTMAN_REPORT_OMIT | Comma-separated cuts for the json and html reporters: headers, requestBodies, responseBodies, all. | ||
POSTMAN_JSON_STRUCTURE | Passed as --reporter-json-structure when the json reporter is enabled, for example newman. | ||
POSTMAN_DEBUG | Set to 1 to print the collection run command on stderr. The API key is left out of that line. |
Report extensions are .xml for junit, .json for json, and .html for html. The default JUnit path is /reports/report.xml. The entrypoint creates the export directory.
-r or --reporters after the image name replaces POSTMAN_REPORTERS. The image then skips the export flags from POSTMAN_REPORT_DIR and POSTMAN_REPORT_BASENAME. A --reporter-<name>-export argument does the same for that one reporter. --reporter-json-structure on the command line is kept as given.
POSTMAN_REPORT_OMIT=all maps to --reporter-<name>-omitAllHeadersAndBody (allHeadersAndBody is the same choice). Any other token stops the run with an error. Omit flags are added for json and html only.
stdout/reports/report.xml unless POSTMAN_REPORT_DIR or POSTMAN_REPORT_BASENAME is changedPOSTMAN_REPORTERSmake builds ghcr.io/rechtlogisch/postman:lts. It pulls a fresh base image and passes TAG as the Node.js tag (node:${TAG}-slim).
make
TAG is typically {major-version}, or lts. IMAGE sets the repository name.
make TAG=24
make IMAGE=rechtlogisch/postman
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
Content type
Image
Digest
sha256:37ffc4cff…
Size
294.8 MB
Last updated
about 23 hours ago
docker pull rechtlogisch/postman:22