Skip to content

feat(ci): Add custom docker-build step#1527

Open
zkdev wants to merge 1 commit intomasterfrom
zkdev-custom-build-step
Open

feat(ci): Add custom docker-build step#1527
zkdev wants to merge 1 commit intomasterfrom
zkdev-custom-build-step

Conversation

@zkdev
Copy link
Member

@zkdev zkdev commented Feb 20, 2026

Useful to have full control over underlaying tooling, such as docker version. Keep step outputs compatible to "build-push-action".

Release note:

NONE

Useful to have full control over underlaying tooling, such as docker
version. Keep step outputs compatible to "build-push-action".

Signed-off-by: Philipp Heil (zkdev) <philipp.heil@sap.com>
@gardener-prow
Copy link

gardener-prow bot commented Feb 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ccwienk for approval. For more information see the Code Review Process.

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

Details 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

@gardener-prow gardener-prow bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 20, 2026
@gardener-robot
Copy link

@ccwienk, @TuanAnh17N, @8R0WNI3 You have pull request review open invite, please check

file: ${{ inputs.dockerfile }}
build-args: ${{ inputs.build-args }}
run: |
IFS=',' read -ra TAGS <<< "${{ matrix.args.image-reference }}"
Copy link
Member

Choose a reason for hiding this comment

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

codestyle: I think it is preferable to use lowercase names for shell-variables, as uppercased variables are typically intended for global / systemwide exports.

In addition, preferably use single-quotes such as to avoid shell-expansion, where we are dereferencing vaules from gha-inputs

fi

docker buildx build \
--file ${{ inputs.dockerfile }} \
Copy link
Member

Choose a reason for hiding this comment

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

quote (there might be a whitespace....)

docker buildx build \
--file ${{ inputs.dockerfile }} \
--output type=docker \
--platform ${{ matrix.args.platform-name }} \
Copy link
Member

Choose a reason for hiding this comment

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

quote. while platform-names will never contain whitespace, errors in args-preprocessing will be easier to detect this way

--file ${{ inputs.dockerfile }} \
--output type=docker \
--platform ${{ matrix.args.platform-name }} \
--builder ${{ steps.buildx-setup.outputs.name }} \
Copy link
Member

Choose a reason for hiding this comment

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

ditto (quote, please)

--platform ${{ matrix.args.platform-name }} \
--builder ${{ steps.buildx-setup.outputs.name }} \
--metadata-file /tmp/metadata.json \
--iidfile /tmp/iidfile \
Copy link
Member

Choose a reason for hiding this comment

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

codestyle: rather call it image_id[_file].

$TARGET_ARG \
$TAG_ARGS \
$BUILD_ARGS \
${{ inputs.build-directory }}
Copy link
Member

Choose a reason for hiding this comment

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

quote

Copy link
Member

Choose a reason for hiding this comment

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

also, we might want to add a check (prior to running build) for build-directory to be non-empty (we might also check whether it is an existing directory..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants