Dockerfile release notes
This page contains information about the new features, improvements, known issues, and bug fixes in Dockerfile reference.
For usage, see the Dockerfile frontend syntax page.
1.12.0
2024-11-27The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.12.0- Fix incorrect description in History line of image configuration with multiple
ARGinstructions. moby/buildkit#5508
1.11.1
2024-11-08The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.11.1- Fix regression when using the
ONBUILDinstruction in stages inherited within the same Dockerfile. moby/buildkit#5490
1.11.0
2024-10-30The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.11.0- The
ONBUILDinstruction now supports commands that refer to other stages or images withfrom, such asCOPY --fromorRUN mount=from=.... moby/buildkit#5357 - The
SecretsUsedInArgOrEnvbuild check has been improved to reduce false positives. moby/buildkit#5208 - A new
InvalidDefinitionDescriptionbuild check recommends formatting comments for build arguments and stages descriptions. This is an experimental check. moby/buildkit#5208, moby/buildkit#5414 - Multiple fixes for the
ONBUILDinstruction's progress and error handling. moby/buildkit#5397 - Improved error reporting for missing flag errors. moby/buildkit#5369
- Enhanced progress output for secret values mounted as environment variables. moby/buildkit#5336
- Added built-in build argument
TARGETSTAGEto expose the name of the (final) target stage for the current build. moby/buildkit#5431
1.11.0-labs
COPY --chmodnow supports non-octal values. moby/buildkit#5380
1.10.0
2024-09-10The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.10.0- Build secrets can now be mounted as environment variables using the
env=VARIABLEoption. moby/buildkit#5215 - The
# checkdirective now allows new experimental attribute for enabling experimental validation rules likeCopyIgnoredFile. moby/buildkit#5213 - Improve validation of unsupported modifiers for variable substitution. moby/buildkit#5146
ADDandCOPYinstructions now support variable interpolation for build arguments for the--chmodoption values. moby/buildkit#5151- Improve validation of the
--chmodoption forCOPYandADDinstructions. moby/buildkit#5148 - Fix missing completions for size and destination attributes on mounts. moby/buildkit#5245
- OCI annotations are now set to the Dockerfile frontend release image. moby/buildkit#5197
1.9.0
2024-07-11The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.9.0- Add new validation rules:
SecretsUsedInArgOrEnvInvalidDefaultArgInFromRedundantTargetPlatformCopyIgnoredFile(experimental)FromPlatformFlagConstDisallowed
- Many performance improvements for working with big Dockerfiles. moby/buildkit#5067, moby/buildkit#5029
- Fix possible panic when building Dockerfile without defined stages. moby/buildkit#5150
- Fix incorrect JSON parsing that could cause some incorrect JSON values to pass without producing an error. moby/buildkit#5107
- Fix a regression where
COPY --linkwith a destination path of.could fail. moby/buildkit#5080 - Fix validation of
ADD --checksumwhen used with a Git URL. moby/buildkit#5085
1.8.1
2024-06-18The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.8.1Bug fixes and enhancements
- Fix handling of empty strings on variable expansion. moby/buildkit#5052
- Improve formatting of build warnings. moby/buildkit#5037, moby/buildkit#5045, moby/buildkit#5046
- Fix possible invalid output for
UndeclaredVariablewarning for multi-stage builds. moby/buildkit#5048
1.8.0
2024-06-11The full release note for this release is available on GitHub.
# syntax=docker/dockerfile:1.8.0- Many new validation rules have been added to verify that your Dockerfile is using best practices. These rules are validated during build and new
checkfrontend method can be used to only trigger validation without completing the whole build. - New directive
#checkand build argumentBUILDKIT_DOCKERFILE_CHECKlets you control the behavior or build checks. moby/buildkit#4962 - Using a single-platform base image that does not match your expected platform is now validated. moby/buildkit#4924
- Errors from the expansion of
ARGdefinitions in global scope are now handled properly. moby/buildkit#4856 - Expansion of the default value of
ARGnow only happens if it is not overwritten by the user. Previously, expansion was completed and value was later ignored, which could result in an unexpected expansion error. moby/buildkit#4856 - Performance of parsing huge Dockerfiles with many stages has been improved. moby/buildkit#4970
- Fix some Windows path handling consistency errors. moby/buildkit#4825
1.7.0
2024-03-06Stable
# syntax=docker/dockerfile:1.7- Variable expansion now allows string substitutions and trimming. moby/buildkit#4427, moby/buildkit#4287
- Named contexts with local sources now correctly transfer only the files used in the Dockerfile instead of the full source directory. moby/buildkit#4161
- Dockerfile now better validates the order of stages and returns nice errors with stack traces if stages are in incorrect order. moby/buildkit#4568, moby/buildkit#4567
- History commit messages now contain flags used with
COPYandADD. moby/buildkit#4597 - Progress messages for
ADDcommands from Git and HTTP sources have been improved. moby/buildkit#4408
Labs
# syntax=docker/dockerfile:1.7-labs- New
--parentsflag has been added toCOPYfor copying files while keeping the parent directory structure. moby/buildkit#4598, moby/buildkit#3001, moby/buildkit#4720, moby/buildkit#4728, docs - New
--excludeflag can be used inCOPYandADDcommands to apply filter to copied files. moby/buildkit#4561, docs
1.6.0
2023-06-13New
- Add
--start-intervalflag to theHEALTHCHECKinstruction.
The following features have graduated from the labs channel to stable:
- The
ADDinstruction can now import files directly from Git URLs - The
ADDinstruction now supports--checksumflag to validate the contents of the remote URL contents
Bug fixes and enhancements
- Variable substitution now supports additional POSIX compatible variants without
:. moby/buildkit#3611 - Exported Windows images now contain OSVersion and OSFeatures values from base image. moby/buildkit#3619
- Changed the permissions for Heredocs to 0644. moby/buildkit#3992
1.5.2
2023-02-14Bug fixes and enhancements
- Fix building from Git reference that is missing branch name but contains a subdir
- 386 platform image is now included in the release
1.5.1
2023-01-18Bug fixes and enhancements
- Fix possible panic when warning conditions appear in multi-platform builds
1.5.0 (labs)
2023-01-10Experimental
The "labs" channel provides early access to Dockerfile features that are not yet available in the stable channel.
New
ADDcommand now supports--checksumflag to validate the contents of the remote URL contents
1.5.0
2023-01-10New
ADDcommand can now import files directly from Git URLs
Bug fixes and enhancements
- Named contexts now support
oci-layout://protocol for including images from local OCI layout structure - Dockerfile now supports secondary requests for listing all build targets or printing outline of accepted parameters for a specific build target
- Dockerfile
#syntaxdirective that redirects to an external frontend image now allows the directive to be also set with//comments or JSON. The file may also contain a shebang header - Named context can now be initialized with an empty scratch image
- Named contexts can now be initialized with an SSH Git URL
- Fix handling of
ONBUILDwhen importing Schema1 images
1.4.3
2022-08-23Bug fixes and enhancements
- Fix creation timestamp not getting reset when building image from
docker-image://named context - Fix passing
--platformflag ofFROMcommand when loadingdocker-image://named context
1.4.2
2022-05-06Bug fixes and enhancements
- Fix loading certain environment variables from an image passed with built context
1.4.1
2022-04-08Bug fixes and enhancements
- Fix named context resolution for cross-compilation cases from input when input is built for a different platform
1.4.0
2022-03-09New
COPY --linkandADD --linkallow copying files with increased cache efficiency and rebase images without requiring them to be rebuilt.--linkcopies files to a separate layer and then uses new LLB MergeOp implementation to chain independent layers together- Heredocs support have been promoted from labs channel to stable. This feature allows writing multiline inline scripts and files
- Additional named build contexts can be passed to build to add or overwrite a stage or an image inside the build. A source for the context can be a local source, image, Git, or HTTP URL
BUILDKIT_SANDBOX_HOSTNAMEbuild-arg can be used to set the default hostname for theRUNsteps
Bug fixes and enhancements
- When using a cross-compilation stage, the target platform for a step is now seen on progress output
- Fix some cases where Heredocs incorrectly removed quotes from content
1.3.1
2021-10-04Bug fixes and enhancements
- Fix parsing "required" mount key without a value
1.3.0 (labs)
2021-07-16Experimental
The "labs" channel provides early access to Dockerfile features that are not yet available in the stable channel.
New
RUNandCOPYcommands now support Here-document syntax allowing writing multiline inline scripts and files
1.3.0
2021-07-16New
RUNcommand allows--networkflag for requesting a specific type of network conditions.--network=hostrequires allowingnetwork.hostentitlement. This feature was previously only available on labs channel
Bug fixes and enhancements
ADDcommand with a remote URL input now correctly handles the--chmodflag- Values for
RUN --mountflag now support variable expansion, except for thefromfield - Allow
BUILDKIT_MULTI_PLATFORMbuild arg to force always creating multi-platform image, even if only contains single platform
1.2.1 (labs)
2020-12-12Experimental
The "labs" channel provides early access to Dockerfile features that are not yet available in the stable channel.
Bug fixes and enhancements
RUNcommand allows--networkflag for requesting a specific type of network conditions.--network=hostrequires allowingnetwork.hostentitlement
1.2.1
2020-12-12Bug fixes and enhancements
- Revert "Ensure ENTRYPOINT command has at least one argument"
- Optimize processing
COPYcalls on multi-platform cross-compilation builds
1.2.0 (labs)
2020-12-03Experimental
The "labs" channel provides early access to Dockerfile features that are not yet available in the stable channel.
Bug fixes and enhancements
- Experimental channel has been renamed to labs
1.2.0
2020-12-03New
RUN --mountsyntax for creating secret, ssh, bind, and cache mounts have been moved to mainline channelARGcommand now supports defining multiple build args on the same line similarly toENV
Bug fixes and enhancements
- Metadata load errors are now handled as fatal to avoid incorrect build results
- Allow lowercase Dockerfile name
--chownflag inADDnow allows parameter expansionENTRYPOINTrequires at least one argument to avoid creating broken images
1.1.7
2020-04-18Bug fixes and enhancements
- Forward
FrontendInputsto the gateway
1.1.2 (experimental)
2019-07-31Experimental
The "labs" channel provides early access to Dockerfile features that are not yet available in the stable channel.
Bug fixes and enhancements
- Allow setting security mode for a process with
RUN --security=sandbox|insecure - Allow setting uid/gid for cache mounts
- Avoid requesting internally linked paths to be pulled to build context
- Ensure missing cache IDs default to target paths
- Allow setting namespace for cache mounts with
BUILDKIT_CACHE_MOUNT_NSbuild arg
1.1.2
2019-07-31Bug fixes and enhancements
- Fix workdir creation with correct user and don't reset custom ownership
- Fix handling empty build args also used as
ENV - Detect circular dependencies
1.1.0
2019-04-27New
ADD/COPYcommands now support implementation based onllb.FileOpand do not require helper image if builtin file operations support is available--chownflag forCOPYcommand now supports variable expansion
Bug fixes and enhancements
- To find the files ignored from the build context Dockerfile frontend will
first look for a file
<path/to/Dockerfile>.dockerignoreand if it is not found.dockerignorefile will be looked up from the root of the build context. This allows projects with multiple Dockerfiles to use different.dockerignoredefinitions