title | description | keywords | toc_max |
---|---|---|---|
Dockerfile release notes |
Release notes for Dockerfile frontend |
build, dockerfile, frontend, release notes |
2 |
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.
{{< release-date date="2024-03-06" >}}
# 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
COPY
andADD
. moby/buildkit#4597 - Progress messages for
ADD
commands from Git and HTTP sources have been improved. moby/buildkit#4408
# syntax=docker/dockerfile:1.7-labs
- New
--parents
flag has been added toCOPY
for copying files while keeping the parent directory structure. moby/buildkit#4598, moby/buildkit#3001, moby/buildkit#4720, moby/buildkit#4728, docs - New
--exclude
flag can be used inCOPY
andADD
commands to apply filter to copied files. moby/buildkit#4561, docs
{{< release-date date="2023-06-13" >}}
- Add
--start-interval
flag to theHEALTHCHECK
instruction.
The following features have graduated from the labs channel to stable:
- The
ADD
instruction can now import files directly from Git URLs - The
ADD
instruction now supports--checksum
flag to validate the contents of the remote URL contents
- 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
{{< release-date date="2023-02-14" >}}
- Fix building from Git reference that is missing branch name but contains a subdir
- 386 platform image is now included in the release
{{< release-date date="2023-01-18" >}}
- Fix possible panic when warning conditions appear in multi-platform builds
{{< release-date date="2023-01-10" >}}
{{< include "dockerfile-labs-channel.md" >}}
ADD
command now supports--checksum
flag to validate the contents of the remote URL contents
{{< release-date date="2023-01-10" >}}
ADD
command can now import files directly from Git URLs
- 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
#syntax
directive 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
ONBUILD
when importing Schema1 images
{{< release-date date="2022-08-23" >}}
- Fix creation timestamp not getting reset when building image from
docker-image://
named context - Fix passing
--platform
flag ofFROM
command when loadingdocker-image://
named context
{{< release-date date="2022-05-06" >}}
- Fix loading certain environment variables from an image passed with built context
{{< release-date date="2022-04-08" >}}
- Fix named context resolution for cross-compilation cases from input when input is built for a different platform
{{< release-date date="2022-03-09" >}}
COPY --link
andADD --link
allow copying files with increased cache efficiency and rebase images without requiring them to be rebuilt.--link
copies 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_HOSTNAME
build-arg can be used to set the default hostname for theRUN
steps
- 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
{{< release-date date="2021-10-04" >}}
- Fix parsing "required" mount key without a value
{{< release-date date="2021-07-16" >}}
{{< include "dockerfile-labs-channel.md" >}}
RUN
andCOPY
commands now support Here-document syntax allowing writing multiline inline scripts and files
{{< release-date date="2021-07-16" >}}
RUN
command allows--network
flag for requesting a specific type of network conditions.--network=host
requires allowingnetwork.host
entitlement. This feature was previously only available on labs channel
ADD
command with a remote URL input now correctly handles the--chmod
flag- Values for
RUN --mount
flag now support variable expansion, except for thefrom
field - Allow
BUILDKIT_MULTI_PLATFORM
build arg to force always creating multi-platform image, even if only contains single platform
{{< release-date date="2020-12-12" >}}
{{< include "dockerfile-labs-channel.md" >}}
RUN
command allows--network
flag for requesting a specific type of network conditions.--network=host
requires allowingnetwork.host
entitlement
{{< release-date date="2020-12-12" >}}
- Revert "Ensure ENTRYPOINT command has at least one argument"
- Optimize processing
COPY
calls on multi-platform cross-compilation builds
{{< release-date date="2020-12-03" >}}
{{< include "dockerfile-labs-channel.md" >}}
- Experimental channel has been renamed to labs
{{< release-date date="2020-12-03" >}}
RUN --mount
syntax for creating secret, ssh, bind, and cache mounts have been moved to mainline channelARG
command now supports defining multiple build args on the same line similarly toENV
- Metadata load errors are now handled as fatal to avoid incorrect build results
- Allow lowercase Dockerfile name
--chown
flag inADD
now allows parameter expansionENTRYPOINT
requires at least one argument to avoid creating broken images
{{< release-date date="2020-04-18" >}}
- Forward
FrontendInputs
to the gateway
{{< release-date date="2019-07-31" >}}
{{< include "dockerfile-labs-channel.md" >}}
- 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_NS
build arg
{{< release-date date="2019-07-31" >}}
- Fix workdir creation with correct user and don't reset custom ownership
- Fix handling empty build args also used as
ENV
- Detect circular dependencies
{{< release-date date="2019-04-27" >}}
ADD/COPY
commands now support implementation based onllb.FileOp
and do not require helper image if builtin file operations support is available--chown
flag forCOPY
command now supports variable expansion
- To find the files ignored from the build context Dockerfile frontend will
first look for a file
<path/to/Dockerfile>.dockerignore
and if it is not found.dockerignore
file will be looked up from the root of the build context. This allows projects with multiple Dockerfiles to use different.dockerignore
definitions