Skip to content

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

@homersimpsons

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions