Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
66 changes: 37 additions & 29 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,52 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Check out code
uses: actions/checkout@v3
- name: Build the Docker images
uses: actions/checkout@v4

- name: Build and Push to KrknChaos Quay
if: startsWith(github.ref, 'refs/tags')
run: |
run: |
./containers/compile_dockerfile.sh
docker build --no-cache -t quay.io/krkn-chaos/krkn containers/ --build-arg TAG=${GITHUB_REF#refs/tags/}
docker tag quay.io/krkn-chaos/krkn quay.io/redhat-chaos/krkn
docker tag quay.io/krkn-chaos/krkn quay.io/krkn-chaos/krkn:${GITHUB_REF#refs/tags/}
docker tag quay.io/krkn-chaos/krkn quay.io/redhat-chaos/krkn:${GITHUB_REF#refs/tags/}
# Login to KrknChaos Quay
echo "${{ secrets.QUAY_PASSWORD }}" | docker login quay.io -u "${{ secrets.QUAY_USERNAME }}" --password-stdin

# Build and Push
docker buildx build --platform linux/amd64,linux/arm64 \
--no-cache \
--output type=image,push=true \
-t quay.io/krkn-chaos/krkn:latest \
-t "quay.io/krkn-chaos/krkn:${GITHUB_REF#refs/tags/}" \
--build-arg "TAG=${GITHUB_REF#refs/tags/}" \
containers/

- name: Test Build the Docker images
if: ${{ github.event_name == 'pull_request' }}
run: |
./containers/compile_dockerfile.sh
docker build --no-cache -t quay.io/krkn-chaos/krkn containers/ --build-arg PR_NUMBER=${{ github.event.pull_request.number }}
- name: Login in quay
if: startsWith(github.ref, 'refs/tags')
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
env:
QUAY_USER: ${{ secrets.QUAY_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
- name: Push the KrknChaos Docker images
if: startsWith(github.ref, 'refs/tags')
run: |
docker push quay.io/krkn-chaos/krkn
docker push quay.io/krkn-chaos/krkn:${GITHUB_REF#refs/tags/}
- name: Login in to redhat-chaos quay
docker buildx build --platform linux/amd64,linux/arm64 \
--no-cache \
-t quay.io/krkn-chaos/krkn:test \
--build-arg PR_NUMBER=${{ github.event.pull_request.number }} \
containers/
- name: Push to RedHat Chaos Quay
if: startsWith(github.ref, 'refs/tags/v')
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
env:
QUAY_USER: ${{ secrets.QUAY_USER_1 }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN_1 }}
- name: Push the RedHat Chaos Docker images
if: startsWith(github.ref, 'refs/tags')
run: |
docker push quay.io/redhat-chaos/krkn
docker push quay.io/redhat-chaos/krkn:${GITHUB_REF#refs/tags/}
run: |
# Login to RedHat Chaos Quay
echo "${{ secrets.QUAY_TOKEN_1 }}" | docker login quay.io -u "${{ secrets.QUAY_USER_1 }}" --password-stdin

# Build and Push (will reuse cache)
docker buildx build --platform linux/amd64,linux/arm64 \
--output type=image,push=true \
-t quay.io/redhat-chaos/krkn:latest \
-t "quay.io/redhat-chaos/krkn:${GITHUB_REF#refs/tags/}" \
--build-arg "TAG=${GITHUB_REF#refs/tags/}" \
containers/
- name: Rebuild krkn-hub
if: startsWith(github.ref, 'refs/tags')
uses: redhat-chaos/actions/krkn-hub@main
Expand Down
27 changes: 14 additions & 13 deletions containers/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
# oc build
FROM golang:1.24.9 AS oc-build
ARG TARGETARCH
RUN apt-get update && apt-get install -y --no-install-recommends libkrb5-dev
WORKDIR /tmp
# oc build
RUN git clone --branch release-4.18 https://github.com/openshift/oc.git
WORKDIR /tmp/oc
RUN go mod edit -go 1.24.9 &&\
go mod edit -require github.com/moby/buildkit@v0.12.5 &&\
go mod edit -require github.com/containerd/containerd@v1.7.29&&\
go mod edit -require github.com/moby/buildkit@v0.19.0 &&\
go mod edit -require github.com/containerd/containerd@v1.7.30&&\
go mod edit -require github.com/docker/docker@v27.5.1+incompatible&&\
go mod edit -require github.com/opencontainers/runc@v1.2.8&&\
go mod edit -require github.com/go-git/go-git/v5@v5.13.0&&\
go mod edit -require github.com/opencontainers/selinux@v1.13.0&&\
go mod edit -require github.com/ulikunitz/xz@v0.5.15&&\
go mod edit -require golang.org/x/net@v0.38.0&&\
go mod edit -require github.com/containerd/containerd@v1.7.27&&\
go mod edit -require golang.org/x/oauth2@v0.27.0&&\
go mod edit -require golang.org/x/crypto@v0.35.0&&\
go mod edit -replace github.com/containerd/containerd@v1.7.27=github.com/containerd/containerd@v1.7.29&&\
go mod edit -require github.com/opencontainers/runc@v1.2.5&&\
go mod edit -require github.com/go-git/go-git/v5@v5.13.2&&\
go mod edit -require github.com/opencontainers/selinux@v1.11.1&&\
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason we are going backwards on some of the versions? it would be good if we could keep current versions we know don't break

Copy link
Author

Choose a reason for hiding this comment

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

I've restored runc, selinux, xz, and golang.org/x/net back to the versions currently on main.
I also cleaned up the duplicate containerd require line (it was listed twice, v1.7.29 and v1.7.27 with a replace directive). Now there's a single containerd@v1.7.30 entry, which makes the replace unnecessary, so I removed that too.

go mod edit -require github.com/ulikunitz/xz@v0.5.13&&\
go mod edit -require golang.org/x/net@v0.35.0&&\
go mod edit -require github.com/containerd/containerd@v1.7.30&&\
go mod edit -require golang.org/x/oauth2@v0.34.0&&\
go mod edit -require golang.org/x/crypto@v0.47.0&&\
go mod edit -replace github.com/containerd/containerd@v1.7.30=github.com/containerd/containerd@v1.7.30&&\
go mod tidy && go mod vendor

RUN make GO_REQUIRED_MIN_VERSION:= oc
RUN GOARCH=$TARGETARCH make GO_REQUIRED_MIN_VERSION:= oc

# virtctl build
WORKDIR /tmp
RUN git clone https://github.com/kubevirt/kubevirt.git
WORKDIR /tmp/kubevirt
RUN go mod edit -go 1.24.9 &&\
go work use &&\
go build -o virtctl ./cmd/virtctl/
GOARCH=$TARGETARCH go build -o virtctl ./cmd/virtctl/

FROM fedora:40
ARG PR_NUMBER
Expand Down