Skip to content

Setting env var matching tag name #1322

Answered by jedevc
robertsLando asked this question in Q&A
Discussion options

You must be logged in to vote

You could create a build arg for this purpose, placing it at the bottom of your Dockerfile:

ARG image

Then during build, you can set this with --build-arg - because the ARG comes last, I think cache should be preserved between different runs of build, so the subsequent builds should be almost instant (except for the time to push to the new registry).

Unfortunately, to get the data, you will need to build multiple times - since this requires changing the runtime environment config, it can't be done without it.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@robertsLando
Comment options

Answer selected by robertsLando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1321 on September 16, 2022 14:06.