Skip to content

Conversation

timothystone
Copy link

Per Docker build-checks:

The correct format for declaring environment variables and build arguments in a Dockerfile is
ENV key=value and ARG key=value, where the variable name (key) and value (value) are
separated by an equals sign (=). Historically, Dockerfiles have also supported a space
separator between the key and the value (for example, ARG key value). This legacy format is
deprecated, and you should only use the format with the equals sign.

This admonition does not mention LABEL, but it is included.

Update the use of LABEL and ENV where necessary to remove deprecation warning.

Fixes #486

@timothystone-knsl timothystone-knsl force-pushed the style/iss-legacy-key-value-format branch from 027468b to d5cf7ce Compare July 22, 2024 16:36
@carlossg
Copy link
Owner

FYI the publish.sh automates a bunch of things to avoid duplication. Changing the Dockerfile-template and running it updates all the other Dockerfiles

@timothystone
Copy link
Author

I didn't see this feature in the publish.sh (well, I almost did, but I was looking at it for another reason, specifically if it opened the PR to the docker-library for release). I pulled your changes, but the ENV= returned in Amazon Corretto 8. Fixed, but if you want to rebase... I'll hold on pushing.

@carlossg carlossg force-pushed the style/iss-legacy-key-value-format branch from 6f084ec to d15fa0c Compare July 22, 2024 20:41
@carlossg carlossg enabled auto-merge (rebase) July 22, 2024 20:41
Per Docker [build-checks](https://docs.docker.com/reference/build-checks/legacy-key-value-format/):

  The correct format for declaring environment variables and build arguments in a Dockerfile is
  `ENV key=value` and `ARG key=value`, where the variable name (`key`) and value (`value`) are
  separated by an equals sign (`=`). Historically, Dockerfiles have also supported a space
  separator between the key and the value (for example, `ARG key value`). This legacy format is
  deprecated, and you should only use the format with the equals sign.

This admonition does not mention `LABEL`, but it is included.

Update the use of `LABEL` and `ENV` where necessary to remove deprecation warning.

Fixes carlossg#486
@carlossg carlossg force-pushed the style/iss-legacy-key-value-format branch from d15fa0c to 4c4581a Compare July 22, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

style: update the use of LegacyKeyValueFormat in Dockerfiles

3 participants