Skip to content

Use ARG instead of ENV for temporary variables - #15

Merged
cverna merged 1 commit into
containers:mainfrom
travier:rework-arg-env
Mar 29, 2023
Merged

cverna merged 1 commit into
containers:mainfrom
travier:rework-arg-env

Conversation

@travier

@travier travier commented Feb 16, 2023

Copy link
Copy Markdown
Member

We only need those temporary variables for the container build and for the LABELS. We do not want to set those specific environment variables for the container environment itself.

Using ARG instead of ENV lets us do that.

See: containers/toolbox#188

Signed-off-by: Timothée Ravier [email protected]

@travier

travier commented Feb 16, 2023

Copy link
Copy Markdown
Member Author

CC @cverna @debarshiray @juhp @HarryMichal

@debarshiray

Copy link
Copy Markdown
Member

Thanks for digging into this, @travier

If ARG is indeed enough, then feel free to open a pull request to change the canonical sources of the fedora-toolbox images.

@travier

travier commented Feb 16, 2023

Copy link
Copy Markdown
Member Author

I've opened https://src.fedoraproject.org/container/fedora-toolbox/pull-request/4.

I'm reasonably confident that this is the right change but I still need someone with more Fedora infra experience to confirm it.

@cverna

cverna commented Feb 22, 2023

Copy link
Copy Markdown
Collaborator

@travier have you tried a scratch build? IIRC, these are used by atomic-reactor during the build so it would be good to double check that builds are still successful after this change.

@cverna

cverna commented Feb 22, 2023

Copy link
Copy Markdown
Collaborator

Hum ok, from a quick look at atomic-reactor it in fact using the LABELS (https://github.com/containerbuildsystem/atomic-reactor/blob/master/atomic_reactor/plugins/bump_release.py#L263) and not the ENV variables so I think this should work 👍

@travier

travier commented Feb 22, 2023

Copy link
Copy Markdown
Member Author

How do I trigger a scratch build? I tried:

$ fedpkg container-build --scratch
Could not execute container_build: There are unpushed changes in your repo

@travier

travier commented Feb 22, 2023 •

Copy link
Copy Markdown
Member Author

We only need those temporary variables for the container build and for
the LABELS. We do not want to set those specific environment variables
for the container environment itself.

Using ARG instead of ENV lets us do that.

The ARG directive only support one value per line thus psplit the
definition into multiple ones.

See: containers/toolbox#188
See: https://docs.docker.com/engine/reference/builder/#arg

Signed-off-by: Timothée Ravier <[email protected]>
@debarshiray

Copy link
Copy Markdown
Member

I've opened https://src.fedoraproject.org/container/fedora-toolbox/pull-request/4.

I'm reasonably confident that this is the right change but I still need someone with more Fedora infra experience to confirm it.

I pulled in the same change to the upstream Toolbx Git repository:
containers/toolbox#1250

@cverna

cverna commented Mar 29, 2023

Copy link
Copy Markdown
Collaborator

Ok merging this, thanks for fixing this.

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.

4 participants