Skip to content

Commit

Permalink
fix(docker): Base image should not refer itself
Browse files Browse the repository at this point in the history
Default internal action image build workflow assume every image should
rely on base context. This caused base image refers to own base context,
causing it to never be refreshed.
Base image now is build without any context, as it should be.

Signed-off-by: Helio Chissini de Castro <[email protected]>
heliocastro authored and tsteenbe committed Nov 10, 2023
1 parent 17f3ad1 commit f1c5959
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/actions/ortdocker/action.yml
Original file line number Diff line number Diff line change
@@ -85,8 +85,26 @@ runs:
type=raw,value=${{ inputs.version }}
type=raw,value=${{ steps.check_image.outputs.result }}
- name: Build base image
if: >
steps.check_image.outputs.result != 'found' &&
inputs.name == 'base'
uses: docker/build-push-action@v5
with:
context: .
target: ${{ inputs.name }}
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
load: false
build-args: ${{ inputs.build-args }}
tags: |
${{ steps.meta.outputs.tags }}
${{ env.REGISTRY }}/${{ github.repository }}/${{ inputs.name }}:latest
labels: ${{ steps.meta.outputs.labels }}

- name: Build image
if: steps.check_image.outputs.result != 'found'
if: >
steps.check_image.outputs.result != 'found' &&
inputs.name != 'base'
uses: docker/build-push-action@v5
with:
context: .

0 comments on commit f1c5959

Please sign in to comment.