Skip to content

[LegacyKeyValueFormat] Document multi-line leading space change #24227

Description

@homersimpsons

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Other

Description

In https://docs.docker.com/reference/build-checks/legacy-key-value-format/ we see the following example:

Image

But they are not strictly equal (as observed in rust-lang/rust#153109 (comment)):

  1. The "Bad" example gives DEPS="curl git make"
  2. The "Good" example gives DEPS=" curl git make" (leading whitespaces)
FROM alpine:3.20
ENV DEPS \
curl \
git \
make
CMD ["printenv", "DEPS"]
$ docker build -t tmp .&& docker run --rm tmp
[...]
curl git make

Location

https://docs.docker.com/reference/build-checks/legacy-key-value-format/

Suggestion

I believe this behaviour change should be documented.

Or maybe this is a Docker bug where the \ should always strip the leading whitespace of the following line? Which would gives curl git make in both cases?

This example was introduced in moby/buildkit#5126.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/buildRelates to Dockerfiles or docker build commandstatus/triageNeeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions