{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "JSON Schema for Hadolint, a Dockerfile linter tool", "description": "Dockerfile linter, validate inline bash, written in Haskell", "type": "object", "additionalProperties": false, "properties": { "disable-ignore-pragma": { "type": "boolean", "description": "Disable inline ignore pragmas `# hadolint ignore=DLxxxx`" }, "failure-threshold": { "type": "string", "description": "A threshold controlling how severe a rule violation must be before the return code indicates failure.", "oneOf": [ { "const": "error", "description": "Never return failure." }, { "const": "warning", "description": "Return failure if only rules of severity above `warning` are violated" }, { "const": "info", "description": "Return failure if only rules of severity above `info` are violated" }, { "const": "style", "description": "Return failure if only rules of severity above `style` are violated" }, { "const": "ignore", "description": "Return failure if any rule is violated." }, { "const": "none", "description": "Return failure if any rule is violated." } ] }, "format": { "type": "string", "enum": [ "tty", "json", "checkstyle", "codeclimate", "gitlab_codeclimate", "gnu", "codacy" ], "description": "Output format" }, "strict-labels": { "type": "boolean", "description": "Strictly adhere to label-schem, don't allow additional labels." }, "label-schema": { "type": "object", "description": "A label-schema. See https://github.com/hadolint/hadolint#linting-labels for reference.", "additionalProperties": true }, "no-color": { "type": "boolean", "description": "Don't colorize output." }, "no-fail": { "type": "boolean", "description": "Don't exit with a failure status code when any rule is violated." }, "override": { "type": "object", "additionalProperties": false, "properties": { "error": { "type": "array", "description": "A list of rules to be treated with \"error\" severity", "items": { "$ref": "#/properties/ignored/items" } }, "warning": { "type": "array", "description": "A list of rules to be treated with \"warning\" severity", "items": { "$ref": "#/properties/ignored/items" } }, "info": { "type": "array", "description": "A list of rules to be treated with \"info\" severity", "items": { "$ref": "#/properties/ignored/items" } }, "style": { "type": "array", "description": "A list of rules to be treated with \"style\" severity", "items": { "$ref": "#/properties/ignored/items" } } } }, "ignored": { "type": "array", "description": "A list of rules to be ignored", "items": { "type": "string", "oneOf": [ { "const": "DL1001", "description": "Please refrain from using inline ignore pragmas # hadolint ignore=DLxxxx", "$comment": "https://github.com/hadolint/hadolint/wiki/DL1001" }, { "const": "DL3000", "description": "Use absolute WORKDIR.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3000" }, { "const": "DL3001", "description": "For some bash commands it makes no sense running them in a Docker container like ssh, vim, shutdown, service, ps, free, top, kill, mount, ifconfig.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3001" }, { "const": "DL3002", "description": "Last user should not be root.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3002" }, { "const": "DL3003", "description": "Use WORKDIR to switch to a directory.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3003" }, { "const": "DL3004", "description": "Do not use sudo as it leads to unpredictable behavior. Use a tool like gosu to enforce root.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3004" }, { "const": "DL3006", "description": "Always tag the version of an image explicitly.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3006" }, { "const": "DL3007", "description": "Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3007" }, { "const": "DL3008", "description": "Pin versions in apt-get install.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3008" }, { "const": "DL3009", "description": "Delete the apt-get lists after installing something.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3009" }, { "const": "DL3010", "description": "Use ADD for extracting archives into an image.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3010" }, { "const": "DL3011", "description": "Valid UNIX ports range from 0 to 65535.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3011" }, { "const": "DL3012", "description": "Multiple `HEALTHCHECK` instructions.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3012" }, { "const": "DL3013", "description": "Pin versions in pip.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3013" }, { "const": "DL3014", "description": "Use the `-y` switch.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3014" }, { "const": "DL3015", "description": "Avoid additional packages by specifying --no-install-recommends.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3015" }, { "const": "DL3016", "description": "Pin versions in `npm`.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3016" }, { "const": "DL3018", "description": "Pin versions in apk add. Instead of `apk add ` use `apk add =`.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3018" }, { "const": "DL3019", "description": "Use the `--no-cache` switch to avoid the need to use `--update` and remove `/var/cache/apk/*` when done installing packages.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3019" }, { "const": "DL3020", "description": "Use `COPY` instead of `ADD` for files and folders.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3020" }, { "const": "DL3021", "description": "`COPY` with more than 2 arguments requires the last argument to end with `/`", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3021" }, { "const": "DL3022", "description": "`COPY --from` should reference a previously defined `FROM` alias", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3022" }, { "const": "DL3023", "description": "`COPY --from` cannot reference its own `FROM` alias", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3023" }, { "const": "DL3024", "description": "`FROM` aliases (stage names) must be unique", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3024" }, { "const": "DL3025", "description": "Use arguments JSON notation for CMD and ENTRYPOINT arguments", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3025" }, { "const": "DL3026", "description": "Use only an allowed registry in the FROM image", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3026" }, { "const": "DL3027", "description": "Do not use `apt` as it is meant to be an end-user tool, use `apt-get` or `apt-cache` instead", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3027" }, { "const": "DL3028", "description": "Pin versions in gem install. Instead of `gem install ` use `gem install :`", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3028" }, { "const": "DL3029", "description": "Do not use --platform flag with FROM.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3029" }, { "const": "DL3030", "description": "Use the `-y` switch to avoid manual input `yum install -y `", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3030" }, { "const": "DL3032", "description": "`yum clean all` missing after yum command.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3032" }, { "const": "DL3033", "description": "Specify version with `yum install -y -`", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3033" }, { "const": "DL3034", "description": "Non-interactive switch missing from `zypper` command: `zypper install -y`", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3034" }, { "const": "DL3035", "description": "Do not use `zypper dist-upgrade`.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3035" }, { "const": "DL3036", "description": "`zypper clean` missing after zypper use.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3036" }, { "const": "DL3037", "description": "Specify version with `zypper install -y [=]`.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3037" }, { "const": "DL3038", "description": "Use the `-y` switch to avoid manual input `dnf install -y `", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3038" }, { "const": "DL3040", "description": "`dnf clean all` missing after dnf command.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3040" }, { "const": "DL3041", "description": "Specify version with `dnf install -y -`", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3041" }, { "const": "DL3042", "description": "Avoid cache directory with `pip install --no-cache-dir `.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3042" }, { "const": "DL3043", "description": "`ONBUILD`, `FROM` or `MAINTAINER` triggered from within `ONBUILD` instruction.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3043" }, { "const": "DL3044", "description": "Do not refer to an environment variable within the same `ENV` statement where it is defined.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3044" }, { "const": "DL3045", "description": "`COPY` to a relative destination without `WORKDIR` set.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3045" }, { "const": "DL3046", "description": " `useradd` without flag `-l` and high UID will result in excessively large Image.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3046" }, { "const": "DL3047", "description": "`wget` without flag `--progress` will result in excessively bloated build logs when downloading larger files.", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3047" }, { "const": "DL3048", "description": "Invalid Label Key", "$comment": "https://github.com/hadolint/hadolint/wiki/DL3048" }, { "const": "DL3049", "description": "Label `