Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
packages: write
# Condition: Run on push to main, published release, OR PR with 'ok-to-image' label
if: |
github.event_name == 'push' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'ok-to-image')) ||
(github.event_name == 'release' && github.event.action == 'published')
runs-on: ubuntu-latest
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
version: latest
endpoint: builders
- name: Login to GHCR
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ok-to-image')
uses: docker/login-action@v4
with:
registry: ghcr.io
Expand All @@ -77,7 +77,7 @@ jobs:
with:
context: .
platforms: linux/amd64, linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ok-to-image') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
target: ${{ matrix.image.target }}
target: ${{ matrix.image.target }}
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags="${LDFLAGS}" -a -o libvirt-provider ./cmd/libvirt-provider/main.go
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on go build -ldflags="${LDFLAGS}" -a -o libvirt-provider ./cmd/libvirt-provider/main.go


# Install irictl-machine
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH GO111MODULE=on \
go install github.com/ironcore-dev/ironcore/irictl-machine/cmd/irictl-machine@main

# Ensure the binary is in a common location
Expand All @@ -59,7 +59,7 @@ RUN if [ "$TARGETARCH" = "$BUILDARCH" ]; then \
FROM busybox:1.37.0-uclibc AS busybox

# Since we're leveraging apt to pull in dependencies, we use `gcr.io/distroless/base` because it includes glibc.
FROM gcr.io/distroless/base-debian11 AS libvirt-provider
FROM gcr.io/distroless/static-debian13 AS libvirt-provider

WORKDIR /
COPY --from=busybox /bin/sh /bin/sh
Expand Down