Skip to content

Dockerfile: use heredocs - #2805

Merged
casperklein merged 2 commits into
docker-mailserver:masterfrom
casperklein:heredocs
Sep 30, 2022
Merged

casperklein merged 2 commits into
docker-mailserver:masterfrom
casperklein:heredocs

Conversation

@casperklein

@casperklein casperklein commented Sep 30, 2022 •

Copy link
Copy Markdown
Member

Description

Since version 1.3-lab of Dockerfile, heredoc syntax is available.

This PR converts the countless && \ lines into better readable heredocs.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Improvement (non-breaking change that does improve existing functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md or the documentation under docs/)
  • If necessary I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@casperklein
casperklein marked this pull request as ready for review September 30, 2022 13:32
@casperklein casperklein self-assigned this Sep 30, 2022
@casperklein
casperklein requested a review from a team September 30, 2022 13:33
@casperklein casperklein added this to the v11.2.0 milestone Sep 30, 2022

@georglauterbach georglauterbach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@georglauterbach
georglauterbach requested a review from a team September 30, 2022 14:24

@wernerfred wernerfred left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL one can use heredocs in Dockerfile, thanks

@polarathene

Copy link
Copy Markdown
Member

Not usually a fan of heredocs myself, but this is a pretty decent use-case for it! 😅

@polarathene

Copy link
Copy Markdown
Member

This took a little while to track down. I wanted to know about the 1.3-labs requirement as -labs is experimental/beta testing channel, not the stable BuildKit releases AFAIK, which I would not be in support of merging as a further restriction on build environments.

Thankfully, this was promoted to a stable in the dockerfile-1.4 syntax release. So it fits with the March 2022 requirement for other features we depend on with changes to Dockerfile for better build caching 👍

@casperklein

Copy link
Copy Markdown
Member Author

I should have been more clear. By writing since I meant that the feature was added in the next non-experimental version (1.4 - which we currently use). I totally agree, not to add any experimental things 👍

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants