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
7 changes: 4 additions & 3 deletions .github/workflows/image-build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Image build
on: [pull_request]
jobs:
build-amd64:
name: Image build/amd64 thin plugin
build:
name: Image build thin plugin
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
Expand All @@ -16,8 +16,9 @@ jobs:
with:
context: .
push: false
tags: ghcr.io/${{ github.repository }}:latest-amd64
tags: ghcr.io/${{ github.repository }}:latest
file: Dockerfile
platforms: linux/amd64,linux/arm64

build-origin:
name: Image build/origin
Expand Down
45 changes: 5 additions & 40 deletions .github/workflows/image-push-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
branches:
- master
jobs:
push-amd64:
name: Image push/amd64
push:
name: Image push
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
Expand All @@ -29,9 +29,10 @@ jobs:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:latest-amd64
ghcr.io/${{ github.repository }}:snapshot-amd64
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:snapshot
file: Dockerfile
platforms: linux/amd64,linux/arm64

push-origin:
name: Image push/origin
Expand Down Expand Up @@ -61,39 +62,3 @@ jobs:
ghcr.io/${{ github.repository }}:latest-origin
ghcr.io/${{ github.repository }}:snapshot-origin
file: Dockerfile.openshift

push-manifest:
needs: [push-amd64]
runs-on: ubuntu-latest
env:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
if: github.repository_owner == 'redhat-nfvpe'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
if: github.repository_owner == 'redhat-nfvpe'
run: |
# snapshot
# get artifacts from previous steps
docker pull ${{ env.REPOSITORY }}:snapshot-amd64

docker manifest create ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-amd64
docker manifest annotate ${{ env.REPOSITORY }}:snapshot ${{ env.REPOSITORY }}:snapshot-amd64 --arch amd64
docker manifest push ${{ env.REPOSITORY }}:snapshot

# latest
# get artifacts from previous steps
docker pull ${{ env.REPOSITORY }}:latest-amd64

docker manifest create ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-amd64
docker manifest annotate ${{ env.REPOSITORY }}:latest ${{ env.REPOSITORY }}:latest-amd64 --arch amd64
docker manifest push ${{ env.REPOSITORY }}:latest
50 changes: 5 additions & 45 deletions .github/workflows/image-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
tags:
- v*
jobs:
push-amd64:
name: Image push/amd64
push:
name: Image push
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
Expand Down Expand Up @@ -36,9 +36,10 @@ jobs:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:stable-amd64
${{ steps.docker_meta.outputs.tags }}-amd64
ghcr.io/${{ github.repository }}:stable
${{ steps.docker_meta.outputs.tags }}
file: Dockerfile
platforms: linux/amd64,linux/arm64

push-origin:
name: Image push/origin
Expand Down Expand Up @@ -75,44 +76,3 @@ jobs:
ghcr.io/${{ github.repository }}:stable-origin
${{ steps.docker_meta.outputs.tags }}-origin
file: Dockerfile.openshift

push-manifest:
needs: [push-amd64]
runs-on: ubuntu-latest
env:
REPOSITORY: ghcr.io/${{ github.repository }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/${{ github.repository }}
tag-latest: false

- name: Login to GitHub Container Registry
if: github.repository_owner == 'redhat-nfvpe'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Create manifest for multi-arch images
if: github.repository_owner == 'redhat-nfvpe'
run: |
# <tag>
# get artifacts from previous steps
docker pull ${{ steps.docker_meta.outputs.tags }}-amd64
docker manifest create ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-amd64
docker manifest annotate ${{ steps.docker_meta.outputs.tags }} ${{ steps.docker_meta.outputs.tags }}-amd64 --arch amd64
docker manifest push ${{ steps.docker_meta.outputs.tags }}

# stable
# get artifacts from previous steps
docker pull ${{ env.REPOSITORY }}:stable-amd64
docker manifest create ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-amd64
docker manifest annotate ${{ env.REPOSITORY }}:stable ${{ env.REPOSITORY }}:stable-amd64 --arch amd64
docker manifest push ${{ env.REPOSITORY }}:stable
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
# This Dockerfile is used to build the image available on DockerHub
FROM centos:centos7 as build
FROM golang:1.18 as build

# Add everything
ADD . /usr/src/cni-route-override

ENV INSTALL_PKGS "git golang"
RUN rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO && \
curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo && \
yum install -y $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
cd /usr/src/cni-route-override && \
./build_linux.sh
RUN /bin/bash /usr/src/cni-route-override/build_linux.sh

FROM alpine
LABEL org.opencontainers.image.source https://github.com/redhat-nfvpe/cni-route-override
Expand Down
2 changes: 0 additions & 2 deletions deployments/daemonset-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ spec:
tier: node
app: route-override
spec:
nodeSelector:
beta.kubernetes.io/arch: amd64
tolerations:
- operator: Exists
effect: NoSchedule
Expand Down