Skip to content
Testaroo
dockerfile419 B

Dockerfile (multi-stage)

A sample multi-stage Dockerfile with a build stage and a slim runtime stage, for testing Dockerfile parsers, linters (hadolint), and syntax highlighting. Illustrative only.

Preview, first 17 linesdockerfile
# Novus Examples — sample multi-stage Dockerfile (illustrative; not built here).
FROM node:22-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/package.json ./
EXPOSE 3000
CMD ["npm", "start"]

Specifications

Format
Dockerfile
Stages
2
Base Image
node:22-alpine

Testing contract

Expected to pass
Scenario
Exercise Dockerfile (multi-stage) in its config workflow. A sample multi-stage Dockerfile with a build stage and a slim runtime stage, for testing Dockerfile parsers, linters (hadolint), and syntax highlighting.
Expected result
16 text lines, decoded as UTF-8; first nonempty line is `# Novus Examples — sample multi-stage Dockerfile (illustrative; not built here).`. Declared feature checks: stages=2; baseImage=node:22-alpine.

What is a .dockerfile file?

A Dockerfile is a plain-text script of instructions that Docker reads to build a container image layer by layer, using directives like FROM, RUN, COPY, and CMD. Each instruction defines a step in assembling a reproducible image. It is the standard definition format for containerized applications.

How to use this file

Use an example Dockerfile to test instruction parsers and linters, build-tool integration, and tooling that analyzes or generates container image definitions.

How to use this file for testing

“Dockerfile (multi-stage)” is a deterministic Testaroo fixture for Config testing, Conversion testing. TOML, INI, YAML, .env, and dotfile configuration samples with nested sections and typed values, for testing config parsers, loaders, and environment tooling.

Documented properties for this file: Dockerfile. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such, expect parsers to fail loudly rather than silently accept them.

Data fixtures document their exact quirks (delimiters, encodings, null handling, schema, and row counts) in the spec table. Point your parser or importer at the file and assert it handles the documented edge cases; clean and deliberately-messy siblings make before/after diffs straightforward.

Point your config loader at the file and assert it reads the documented sections and typed values, including any deliberately-tricky nesting or comments.

Generated by generation/data_dev_fixtures.py. Free for any use, no attribution required, license.