Format Dockerfile Online — Instruction Normalizer

Normalize Dockerfile instruction casing and spacing with dockerfile-utils — browser-local formatting.

Loading…
Dockerfile formatter, instruction normalization
Turn lowercase or inconsistent Dockerfiles into readable, review-friendly instructions before you open a PR or share them in docs.

Developer notes

Uses dockerfile-utils for instruction casing and spacing. Auto-format on paste/upload/sample; manual edits use the Format button (⌘↵). Not a substitute for Hadolint best-practice linting — use lint-dockerfile. Processing stays in the browser (dockerfile-utils loads on demand).

When teams pick this route

Normalize Dockerfiles copied from blog posts (often lowercase). Prepare a Dockerfile snippet for internal style guides. Quick format before lint-dockerfile for DL rules. Clean up hand-edited multi-stage files.

Worked examples

Lowercase instructions from a tutorial

Before

from node:20-alpine workdir /app copy package*.json ./ run npm ci --omit=dev copy . . expose 3000 cmd ["npm", "start"]

After format

FROM node:20-alpine WORKDIR /app COPY package*.json ./ RUN npm ci --omit=dev COPY . . EXPOSE 3000 CMD ["npm", "start"]

Multi-stage build skeleton

Before

from golang:1.22 AS build workdir /src copy go.mod go.sum ./ run go build -o /bin/api ./cmd/api from gcr.io/distroless/base COPY --from=build /bin/api /api entrypoint ["/api"]

After format

FROM golang:1.22 AS build WORKDIR /src COPY go.mod go.sum ./ RUN go build -o /bin/api ./cmd/api FROM gcr.io/distroless/base COPY --from=build /bin/api /api ENTRYPOINT ["/api"]

Navigate related DevOps tools

Run lint Dockerfile for DL rules, or open the DevOps hub.

Dockerfile formatter FAQ

Layout and casing

Same as hadolint?

No, this tool formats layout and casing. Use lint-dockerfile for best-practice DL rules.

Does it fix JSON CMD form?

It normalizes keywords; switch shell-form CMD to JSON manually or via lint suggestions.

Multi-stage builds?

Yes, each stage is formatted in place.

Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.