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

add documentation comments to dockerfile #1254

Merged
merged 1 commit into from
Jan 7, 2021
Merged

add documentation comments to dockerfile #1254

merged 1 commit into from
Jan 7, 2021

Conversation

webern
Copy link
Contributor

@webern webern commented Dec 29, 2020

Some separation and comments in the Dockerfile to help those who may be
reading it for the first time.

Issue number:

N/A

Description of changes:

I'm trying to better understand the build process and found it difficult to get a foothold in the Dockerfile. I think this may help the next person.

Explaining what RUN --mount=target=/host means at the top might seem weird, but I spent a lot of time digging to try and figure that out. Eventually I had to test it in a minimal Dockerfile to actually get it (the documentation I found didn't fully illuminate that buidlkit feature for me).

Adding the cat separators before each FROM makes it easier to scroll back and reference the previous build stage.

Testing done:

N/A

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Copy link
Contributor

@srgothi92 srgothi92 left a comment

Choose a reason for hiding this comment

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

💯

Dockerfile Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Dec 29, 2020

webern force-pushed the webern:dockerfile-doc branch from 52c5311 to cfc9bf6 20 seconds ago

I gave whiskers to the cats.

The lack of wrap-width consistency is driving me a little bit crazy. I don't suppose there's anything we can do about those long --mount lines, but everything else could be hard wrapped/re-wrapped at some width. 80 is a bit short for this file, but 100 would be a bit wide. Lines 18-22 are wrapped at about 90 which feels right.

Dockerfile Outdated Show resolved Hide resolved
@tjkirch tjkirch requested a review from bcressey January 4, 2021 16:02
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🖖

Copy link
Contributor

@bcressey bcressey left a comment

Choose a reason for hiding this comment

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

The lack of wrap-width consistency is driving me a little bit crazy. I don't suppose there's anything we can do about those long --mount lines, but everything else could be hard wrapped/re-wrapped at some width. 80 is a bit short for this file, but 100 would be a bit wide. Lines 18-22 are wrapped at about 90 which feels right.

It's fine with me if you want to fix that here. I would just ask that you not re-expand the command lines that are already split up - like createrepo_c and dnf -y - since I find the current format more readable. But the comments and the very long find commands are fair game.

Dockerfile Outdated Show resolved Hide resolved
@webern
Copy link
Contributor Author

webern commented Jan 6, 2021

webern force-pushed the webern:dockerfile-doc branch from cfc9bf6 to b8646f6 1 minute ago

I placed a ruler on the right-most cat whisker and wrapped things that overhung it. I rewrapped comments that were at a shorter width.

To me this is much prettier. Unfortunately the RUN --mount lines that are long cannot be wrapped and have their next line indented (no spaces allowed), but I think even this less-ideal wrap is better than hanging off the edge of the world.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Some separation and comments in the Dockerfile to help those who may be
reading it for the first time.
@webern
Copy link
Contributor Author

webern commented Jan 7, 2021

webern force-pushed the webern:dockerfile-doc branch from b8646f6 to 983cb52 1 minute ago

I restored the --mount lines to their less-controversial long form, and took @tjkirch's other suggestion.

Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🐙

@gregdek gregdek added the status/needs-triage Pending triage or re-evaluation label Jan 7, 2021
@tjkirch tjkirch removed the status/needs-triage Pending triage or re-evaluation label Jan 7, 2021
@webern webern merged commit 5597be2 into bottlerocket-os:develop Jan 7, 2021
@webern webern deleted the dockerfile-doc branch January 7, 2021 19:28
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.

8 participants