Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'ENV variable=xxx' instead of 'ENV variable xxx' #1900

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

MarkEWaite
Copy link
Contributor

Use ENV variable=xxx instead of ENV variable xxx

The Docker ENV documentation says:

The ENV instruction also allows an alternative syntax ENV , omitting the =.

This syntax does not allow for multiple environment-variables to be set in a single ENV instruction, and can be confusing.

The alternative syntax is supported for backward compatibility, but discouraged for the reasons outlined above, and may be removed in a future release.

Recent versions of docker build now issue a warning about the use of the older syntax. Rather than have warnings displayed in our builds, let's switch to the newer syntax.

Testing done

  • Successfully ran make build and make test on my Linux
  • Successfully transitioned my personal container definitions to new syntax without issue

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

https://docs.docker.com/reference/dockerfile/#env says:

> The ENV instruction also allows an alternative syntax ENV <key> <value>,
> omitting the =.

> This syntax does not allow for multiple environment-variables to be
> set in a single ENV instruction, and can be confusing.

> The alternative syntax is supported for backward compatibility, but
> discouraged for the reasons outlined above, and may be removed in a
> future release.

Recent versions of `docker build` now issue a warning about the use of
the older syntax.  Rather than have warnings displayed in our builds,
let's switch to the newer syntax.

Testing done:

* Successfully ran `make build` and `make test` on my Linux
* Successfully transitioned my personal container definitions to new syntax without issue
@MarkEWaite MarkEWaite requested a review from a team as a code owner June 25, 2024 19:12
@MarkEWaite MarkEWaite changed the title Use ENV variable=xxx instead of ENV variable xxx Use ENV variable=xxx instead of ENV variable xxx Jun 25, 2024
@MarkEWaite MarkEWaite changed the title Use ENV variable=xxx instead of ENV variable xxx Use 'ENV variable=xxx' instead of 'ENV variable xxx' Jun 25, 2024
@MarkEWaite MarkEWaite merged commit 217e7c7 into jenkinsci:master Jun 25, 2024
12 checks passed
lemeurherve pushed a commit to lemeurherve/docker that referenced this pull request Jul 10, 2024
https://docs.docker.com/reference/dockerfile/#env says:

> The ENV instruction also allows an alternative syntax ENV <key> <value>,
> omitting the =.

> This syntax does not allow for multiple environment-variables to be
> set in a single ENV instruction, and can be confusing.

> The alternative syntax is supported for backward compatibility, but
> discouraged for the reasons outlined above, and may be removed in a
> future release.

Recent versions of `docker build` now issue a warning about the use of
the older syntax.  Rather than have warnings displayed in our builds,
let's switch to the newer syntax.

Testing done:

* Successfully ran `make build` and `make test` on my Linux
* Successfully transitioned my personal container definitions to new syntax without issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants