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

ci: Move IMAGE_TAG Dockerfile ARG into build phase #15983

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

chaudum
Copy link
Contributor

@chaudum chaudum commented Jan 28, 2025

What this PR does / why we need it:

In order to access the variable ${IMAGE_TAG} that is provided as --build-arg IMAGE_TAG=x.x.x in the docker build command, the ARG definition in the Dockerfile needs to be inside the build step block, otherwise it is empty.

Special notes for your reviewer:

Fix for ##15939

In order to access the variable ${IMAGE_TAG} that is provided as
`--build-arg IMAGE_TAG=x.x.x` in the `docker build` command, the `ARG`
definition in the Dockerfile needs to be inside the build step block,
otherwise it is empty.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
@chaudum chaudum requested a review from a team as a code owner January 28, 2025 15:20
@chaudum chaudum enabled auto-merge (squash) January 28, 2025 15:31
@chaudum chaudum merged commit ed061b3 into main Jan 28, 2025
60 checks passed
@chaudum chaudum deleted the chaudum/fix-ci-build-info branch January 28, 2025 16:23
loki-gh-app bot pushed a commit that referenced this pull request Feb 12, 2025
In order to access the variable ${IMAGE_TAG} that is provided as `--build-arg IMAGE_TAG=x.x.x` in the `docker build` command, the `ARG` definition in the Dockerfile needs to be inside the build step block, otherwise it is empty.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
(cherry picked from commit ed061b3)
@loki-gh-app
Copy link
Contributor

loki-gh-app bot commented Feb 12, 2025

The backport to release-3.3.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-15983-to-release-3.3.x origin/release-3.3.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x ed061b3edd2a8006fddf6cad5b8226a2a1f337d6

When the conflicts are resolved, stage and commit the changes:

git add . && git cherry-pick --continue

If you have the GitHub CLI installed:

# Push the branch to GitHub:
git push --set-upstream origin backport-15983-to-release-3.3.x
# Create the PR body template
PR_BODY=$(gh pr view 15983 --json body --template 'Backport ed061b3edd2a8006fddf6cad5b8226a2a1f337d6 from #15983{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title 'ci: Move IMAGE_TAG Dockerfile ARG into build phase (backport release-3.3.x)' --body-file - --label 'size/S' --label 'type/ci' --label 'backport' --base release-3.3.x --milestone release-3.3.x --web

Or, if you don't have the GitHub CLI installed (we recommend you install it!):

# Push the branch to GitHub:
git push --set-upstream origin backport-15983-to-release-3.3.x

# Create a pull request where the `base` branch is `release-3.3.x` and the `compare`/`head` branch is `backport-15983-to-release-3.3.x`.

# Remove the local backport branch
git switch main
git branch -D backport-15983-to-release-3.3.x

salvacorts pushed a commit that referenced this pull request Feb 12, 2025
In order to access the variable ${IMAGE_TAG} that is provided as `--build-arg IMAGE_TAG=x.x.x` in the `docker build` command, the `ARG` definition in the Dockerfile needs to be inside the build step block, otherwise it is empty.

Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
(cherry picked from commit ed061b3)
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.

3 participants