Skip to content
Open
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
89 changes: 7 additions & 82 deletions .github/workflows/image-push-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,16 @@ name: "push images on merge to master"

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x

on:
push:
branches:
- master
jobs:
build-and-push-amd64-ib-sriov-cni:
name: image push amd64
runs-on: ubuntu-24.04
steps:
- name: check out the repo
uses: actions/checkout@v5

- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: login to Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and push ib-sriov-cni
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_NAME }}:latest-amd64
file: ./Dockerfile

build-and-push-arm64-ib-sriov-cni:
name: image push arm64
runs-on: ubuntu-24.04
steps:
- name: check out the repo
uses: actions/checkout@v5

- name: set up QEMU
uses: docker/setup-qemu-action@v3

- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: login to Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and push ib-sriov-cni
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/arm64
tags: |
${{ env.IMAGE_NAME }}:latest-arm64
file: ./Dockerfile

build-and-push-ppc64le-ib-sriov-cni:
name: image Push ppc64le
jobs:
build-and-push-ib-sriov-cni:
name: build and push multi-arch image (Master)
runs-on: ubuntu-24.04
steps:
- name: check out the repo
Expand All @@ -85,33 +30,13 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: build and push ib-sriov-cni
- name: build and push ib-sriov-cni (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/ppc64le
platforms: ${{ env.PLATFORMS }}
tags: |
${{ env.IMAGE_NAME }}:latest-ppc64le
${{ env.IMAGE_NAME }}:latest
file: ./Dockerfile

push-manifest:
runs-on: ubuntu-24.04
needs: [build-and-push-amd64-ib-sriov-cni,build-and-push-arm64-ib-sriov-cni,build-and-push-ppc64le-ib-sriov-cni]
steps:
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
run: |
docker buildx imagetools create -t ${{ env.IMAGE_NAME }}:latest -t ${{ env.IMAGE_NAME }}:${{ github.sha }} \
${{ env.IMAGE_NAME }}:latest-amd64 \
${{ env.IMAGE_NAME }}:latest-arm64 \
${{ env.IMAGE_NAME }}:latest-ppc64le
117 changes: 7 additions & 110 deletions .github/workflows/image-push-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,17 @@ name: "push images on release"

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x

on:
push:
tags:
- v*
jobs:
build-and-push-amd64-ib-sriov-cni:
runs-on: ubuntu-24.04
name: image push AMD64
steps:
- name: check out the repo
uses: actions/checkout@v5

- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: login to Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
- name: build and push ib-sriov-cni
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64
tags: |
${{ steps.docker_meta.outputs.tags }}-amd64
file: ./Dockerfile

build-and-push-arm64-ib-sriov-cni:
runs-on: ubuntu-24.04
name: image push ARM64
steps:
- name: check out the repo
uses: actions/checkout@v5

- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: login to Docker
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
- name: build and push ib-sriov-cni
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/arm64
tags: |
${{ steps.docker_meta.outputs.tags }}-arm64
file: ./Dockerfile

build-and-push-ppc64le-ib-sriov-cni:
jobs:
build-and-push-ib-sriov-cni:
runs-on: ubuntu-24.04
name: image push ppc64le
name: build and push multi-arch image (Release)
steps:
- name: check out the repo
uses: actions/checkout@v5
Expand All @@ -109,43 +37,12 @@ jobs:
tags: |
type=ref,event=tag
- name: build and push ib-sriov-cni
- name: build and push ib-sriov-cni (multi-arch)
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/arm64
platforms: ${{ env.PLATFORMS }}
tags: |
${{ steps.docker_meta.outputs.tags }}-ppc64le
${{ steps.docker_meta.outputs.tags }}
file: ./Dockerfile

push-manifest:
runs-on: ubuntu-24.04
needs: [build-and-push-amd64-ib-sriov-cni,build-and-push-arm64-ib-sriov-cni,build-and-push-ppc64le-ib-sriov-cni]
steps:
- name: set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=ref,event=tag
- name: login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: create manifest for multi-arch images
run: |
docker buildx imagetools create -t ${{ steps.docker_meta.outputs.tags }} \
${{ steps.docker_meta.outputs.tags }}-amd64 \
${{ steps.docker_meta.outputs.tags }}-arm64 \
${{ steps.docker_meta.outputs.tags }}-ppc64le
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
FROM golang:1.24-alpine as builder
FROM golang:1.24-alpine AS builder

COPY . /usr/src/ib-sriov-cni

ENV HTTP_PROXY $http_proxy
ENV HTTPS_PROXY $https_proxy
ARG TARGETOS
ARG TARGETARCH
ARG http_proxy
ARG https_proxy

ENV HTTP_PROXY=$http_proxy \
HTTPS_PROXY=$https_proxy \
GOOS=$TARGETOS \
GOARCH=$TARGETARCH

RUN apk add --no-cache --virtual build-dependencies build-base=~0.5
WORKDIR /usr/src/ib-sriov-cni
Expand Down
Loading