The Dockerfile legacy “ENV key value” form is deprecated
Deprecated. The source gives no day. Replacement: The ENV key=value form, with the value quoted when it contains spaces. Source: Docker build check: LegacyKeyValueFormat.
Check a version:
evergreen check pkg:generic/dockerfile
Docker’s LegacyKeyValueFormat build check flags the space-separated ENV form and recommends writing each assignment as key=value.
Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>
| Status | Deprecated |
| Severity | low |
| Ecosystem | container |
| Component | pkg:generic/dockerfile |
| Affected versions | vers:semver/* |
| Date from the source | The source gives no day |
| Replacement | The ENV key=value form, with the value quoted when it contains spaces |
| Evidence last seen | 2026-10-31 |
| Reviewed | 2026-10-31 by arminazimi |
| Review due | 2027-10-31 (365 days after the last review) |
| Rule ID | container.dockerfile.legacy-env-format |
Sources
- Docker build check: LegacyKeyValueFormat (accessed 2026-10-31)
- Dockerfile reference: ENV (accessed 2026-10-31)
Migration
Constraints
- Keep the variable name and its value unchanged.
- Use one key=value assignment per variable.
Steps
- Write the variable as key=value. Replace ENV key value with ENV key=”value”, quoting the value when it contains spaces.
Verification
docker build .: Build the image with the rewritten Dockerfile.docker run --rm IMAGE env: Confirm the variable keeps its name and value.
Detected by
The container detector. See Detectors and Compatibility.
Related
Other versions of this product
Same ecosystem
- Alpine Linux image release lines 3.20 and older are end-of-life
- Alpine Linux image release line 3.21 is end-of-life
- Caddy image release lines 1 and older are end-of-life
- ClickHouse image release lines 26.2 and older are end-of-life
- Couchbase Server image release lines 7.2 and older are end-of-life
- Apache CouchDB image release lines 3.3 and older are end-of-life
- Debian image release lines 11 and older are end-of-life
- Drupal image release lines 10.5 and older are end-of-life
Data
This page is generated from registry/container.json, rule container.dockerfile.legacy-env-format, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.
Last updated