Skip to content

Commit

Permalink
Build UBI image within Antrea project
Browse files Browse the repository at this point in the history
  • Loading branch information
ksamoray committed Feb 10, 2022
1 parent a619cb7 commit 53ccd3b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -55,6 +55,22 @@ jobs:
token: ${{ secrets.ANTREA_BUILD_INFRA_WORKFLOW_DISPATCH_PAT }}
inputs: ${{ format('{{ "antrea-repository":"antrea-io/antrea", "antrea-ref":"{0}", "docker-tag":"{1}" }}', github.ref, 'latest') }}

build-ubi:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }}
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Build and push Antrea UBI8 Docker image to registry
if: ${{ github.repository == 'antrea-io/antrea' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
./hack/build-antrea-linux-all.sh --pull --push-base-images --distro ubi
docker push antrea/antrea-ubi:latest
build-scale:
needs: check-changes
if: ${{ needs.check-changes.outputs.has_changes == 'yes' || github.event_name == 'push' }}
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/build_tag.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
needs: get-version
steps:
- uses: actions/checkout@v2
- name: Build and push Antrea amd64 Docker image to registry
- name: Build and push Antrea Ubuntu amd64 Docker image to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
Expand All @@ -43,6 +43,21 @@ jobs:
token: ${{ secrets.ANTREA_BUILD_INFRA_WORKFLOW_DISPATCH_PAT }}
inputs: ${{ format('{{ "antrea-repository":"antrea-io/antrea", "antrea-ref":"{0}", "docker-tag":"{1}" }}', github.ref, needs.get-version.outputs.version) }}

build-ubi:
runs-on: [ubuntu-latest]
needs: get-version
steps:
- uses: actions/checkout@v2
- name: Build and push Antrea UBI8 amd64 Docker image to registry
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
VERSION: ${{ needs.get-version.outputs.version }}
run: |
./hack/build-antrea-linux-all.sh --pull --distro ubi
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push antrea/antrea-ubi:"${VERSION}"
build-windows:
runs-on: [windows-2019]
needs: get-version
Expand Down
2 changes: 1 addition & 1 deletion build/images/base/Dockerfile.ubi
Expand Up @@ -30,6 +30,6 @@ LABEL description="Takes care of building the Antrea binaries as part of buildin

USER root

RUN yum install ipset jq -y
RUN yum install ipset jq -y && yum clean all

COPY --from=cni-binaries /opt/cni/bin /opt/cni/bin

0 comments on commit 53ccd3b

Please sign in to comment.