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

Docs: Semiautomatic platform ARGs #2084

Merged
merged 3 commits into from
Jul 12, 2024

Conversation

cevich
Copy link
Member

@cevich cevich commented Jul 10, 2024

Available for quite some time, but often useful and undocumented.
Fix that and a minor whitespace problem.

Also (minor), rename "buildah bud" to "buildah build".

Fixes: #1935

Ref. Dockerfile docs

The `bud` sub-command has been a hidden alias to `build` for quite a
while.  Fix the documentation accordingly.

Signed-off-by: Chris Evich <cevich@redhat.com>
@cevich cevich force-pushed the magic_platform_args branch 3 times, most recently from 22e4582 to 69922d8 Compare July 10, 2024 18:08
@cevich cevich marked this pull request as ready for review July 10, 2024 18:13
@cevich
Copy link
Member Author

cevich commented Jul 10, 2024

Note: I'm not entirely happy with the way the new header renders in markdown or as a man page. However, it's consistent with the rest of the document (which also renders incomplete/badly). For example anything surrounded by GT/LT characters (like <name>) is completely missing. I'm not going to fix that in this PR. This PR is just about documenting important build-args, cleanup can happen later.

@cevich
Copy link
Member Author

cevich commented Jul 10, 2024

@edsantiago and @rhatdan I'd love your feedback when you get a chance. This isn't critical, but would be nice to have 😄

Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

As someone unfamiliar with these variables, it took me a really long time to understand this wording. Would you mind retrying, trying to target a reader familiar with the intended use of these variables but not the magic "ARG xxx" syntax?

docs/Containerfile.5.md Outdated Show resolved Hide resolved
docs/Containerfile.5.md Outdated Show resolved Hide resolved
about the host performing the build, and the "TARGET" prefix represents
the intended platform for the content.

Each of the following ARG variables must be defined empty before use,
Copy link
Member

Choose a reason for hiding this comment

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

I'm still unable to understand what "defined empty" means, even after many rereadings over several hours

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a really dumb (Docker) design. You literally put (for example) ARG TARGETARCH in your Containerfile. Forever after that, you can reference ${TARGETARCH} and it will hold the value (for example) amd64 or ppc64le depending on what platform the build is happening for.

@cevich
Copy link
Member Author

cevich commented Jul 11, 2024

target a reader familiar with the intended use of these variables but not the magic "ARG xxx" syntax?

I think this is a good suggestion, but I'm slightly confused with the wording. Do you mean, target a reader familiar with the use of --build-arg and ARG <name>[=value], but not the specific TARGET* and BUILD* names?

All/most markdown renderers will mask any naked `<` and `>` characters
that appear in the plain text.  This was making the documented syntax
of the `ARG` command unintelligible.  Fix this.

Signed-off-by: Chris Evich <cevich@redhat.com>
Available for quite some time, but often useful and undocumented.
Fix that and a minor whitespace problem.

Signed-off-by: Chris Evich <cevich@redhat.com>
@cevich
Copy link
Member Author

cevich commented Jul 11, 2024

Force-push: Hopefully this addresses Ed's concerns.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

openshift-ci bot commented Jul 11, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cevich, edsantiago, flouthoc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jul 12, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 06f8a6b into containers:main Jul 12, 2024
14 checks passed
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.

Containerfile.5.md should document "magic" build-args
4 participants