Skip to content

Use more descriptive long-form options for curl, tar, and checksum validation - #6496

Merged
lbussell merged 13 commits into
dotnet:nightlyfrom
lbussell:curl-args
Jun 20, 2025
Merged

lbussell merged 13 commits into
dotnet:nightlyfrom
lbussell:curl-args

Conversation

@lbussell

@lbussell lbussell commented Jun 19, 2025 •

Copy link
Copy Markdown
Member

Reading through our Dockerfiles can be a little confusing if you're not familiar with specific command line option abbreviations for curl, tar, etc.

This PR attempts to make them easier to read by using the long-form options:

  • curl -fSLO -> curl --fail --silent --location --output
  • tar -oxzf -> tar --gzip --extract --no-same-owner --file
  • sha512sum -c ... -> sha512sum --check ...

@lbussell
lbussell requested review from a team, benjaminpetit, joperezr and wiktork as code owners June 19, 2025 17:26

@mthalman mthalman 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.

This is limited to the three commands you described. Are there plans to expand this everywhere? At a glance, I can see ln and mkdir as candidates. I guess what's the overall plan here?

@richlander

Copy link
Copy Markdown
Member

Here's a HN post that describes much the same thing: https://news.ycombinator.com/item?id=43440184. It's useful context for folks (including us, later) who want to understand the motivation.

@lbussell

Copy link
Copy Markdown
Member Author

Yes, I acknowledge that I left out mkdir and ln (and probably others). I can add them. I will also update CONTRIBUTING.md accordingly.

@mthalman mthalman 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.

Other commands I see that can use long form are rm -rf and useradd -l.

lbussell added 2 commits June 19, 2025 15:12
- tdnf install
- useradd
- apt-get install
- rm
@lbussell

lbussell commented Jun 20, 2025 •

Copy link
Copy Markdown
Member Author

OK, here's what I did:

  • CONTRIBUTING.md now says the cli option choice is a preference, not a directive
  • Reverted rm -rf because it is obvious
  • Reverted ln -s and sha512sum -c because the alpine/busybox versions of those only support the shorthand arguments, and it keeps the templates simple and the Dockerfiles consistent
  • Reverted package manager assume-yes changes per your comment.

@mthalman mthalman 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.

This strikes a good balance of short and long form, I think.

@lbussell

Copy link
Copy Markdown
Member Author

(Markdown link check failure is a false positive)

@lbussell
lbussell merged commit 413bf98 into dotnet:nightly Jun 20, 2025
@lbussell
lbussell deleted the curl-args branch June 23, 2025 16:38
lbussell added a commit to lbussell/dotnet-docker that referenced this pull request Jul 7, 2025
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.

3 participants