diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..09519df --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,37 @@ +name: Build Docker Container + +on: + push: + branches: + - main + schedule: + # Build every 6 hours + - cron: "0 */6 * * *" + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + 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.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set BIRD version + run: echo "BIRD_VERSION=$(curl -s 'https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/b/' | awk -F'"' '/>bird-/ {print $6; exit}' | sed -e 's/bird-//' -e 's/\.el.*.rpm//')" >> $GITHUB_ENV + - name: Print target BIRD version + run: echo ${{ env.BIRD_VERSION }} + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + file: Containerfile + build-args: | + BIRD_VERSION=${{ env.BIRD_VERSION }} + tags: | + ghcr.io/sonix-network/bird:${{ env.BIRD_VERSION }} + ghcr.io/sonix-network/bird:latest diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3268211 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.sw? diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..5fe1c3c --- /dev/null +++ b/Containerfile @@ -0,0 +1,11 @@ +FROM docker.io/library/rockylinux:9 + +ARG BIRD_VERSION + +RUN dnf -y update && \ + dnf -y upgrade && \ + dnf -y install epel-release && \ + dnf -y install bird-${BIRD_VERSION}.* && \ + dnf clean all + +ENTRYPOINT ["/usr/sbin/bird"]