diff --git a/.github/workflows/peerpod-ctrl_image.yaml b/.github/workflows/peerpod-ctrl_image.yaml index 8f480b4f58..889bcec39a 100644 --- a/.github/workflows/peerpod-ctrl_image.yaml +++ b/.github/workflows/peerpod-ctrl_image.yaml @@ -9,6 +9,7 @@ on: push: branches: - main + - huoqifeng/peerpod-ctl-img paths: - 'peerpod-ctrl/**' diff --git a/peerpod-ctrl/Dockerfile b/peerpod-ctrl/Dockerfile index b8e32f8731..12f5c82725 100644 --- a/peerpod-ctrl/Dockerfile +++ b/peerpod-ctrl/Dockerfile @@ -27,8 +27,11 @@ COPY controllers/ controllers/ # CC=gcc because the cgo compiler will always be gcc in image golang-fedora, even for s390x and ppc64le RUN CC=gcc CGO_ENABLED=${CGO_ENABLED} GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build ${GOFLAGS} -a -o manager main.go +# Target Image FROM --platform=$TARGETPLATFORM fedora:36 -RUN if [ "$CGO_ENABLED" = 1 ] ; then dnf install -y libvirt-libs /usr/bin/ssh && dnf clean all; fi +ARG CGO_ENABLED=1 + +RUN if [ "$CGO_ENABLED" = 1 ] ; then dnf install -y libvirt-libs && dnf clean all; fi WORKDIR / COPY --from=builder /workspace/manager .