-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b2ac3ef
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Create and publish a Docker image | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
workflow_run: | ||
workflows: [ "Rust" ] | ||
types: | ||
- completed | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- dockerfile: ./bird/Dockerfile | ||
image: ghcr.io/nxthdr/bird | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@7ca345011ac4304463197fac0e56eab1bc7e6af0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@0de3687b53cd804b63dd87819f7bda043569ce4a | ||
with: | ||
images: ${{ matrix.image }} | ||
|
||
- name: Sync theme submodule | ||
run: git submodule sync && git submodule update --init --recursive | ||
|
||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@5e99dacf67635c4f273e532b9266ddb609b3025a | ||
with: | ||
context: . | ||
file: ${{ matrix.dockerfile }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ matrix.image }} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Docker Images | ||
|
||
Generating Docker images for external applications, when necessary. | ||
Images for nxthdr's software are generated in each repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM ubuntu:24.04 AS builder | ||
|
||
ARG BIRD_VERION=2.15.1 | ||
ARG BIRD_PROTOCOLS=bmp,bgp,rpki,static | ||
|
||
RUN apt update -y && \ | ||
apt install -y --no-install-recommends --no-install-suggests \ | ||
bison \ | ||
ca-certificates \ | ||
curl \ | ||
flex \ | ||
gcc \ | ||
libncurses-dev \ | ||
libreadline-dev \ | ||
libssh-dev \ | ||
m4 \ | ||
make \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN curl -o /tmp/bird-${BIRD_VERION}.tar.gz https://bird.network.cz/download/bird-${BIRD_VERION}.tar.gz | ||
RUN tar xvzf /tmp/bird-${BIRD_VERION}.tar.gz -C /tmp | ||
|
||
RUN cd /tmp/bird-${BIRD_VERION} \ | ||
&& ./configure \ | ||
--prefix=/usr/ \ | ||
--sysconfdir=/etc/bird/ \ | ||
--localstatedir=/var/ \ | ||
--enable-libssh \ | ||
--with-protocols=${BIRD_PROTOCOLS} \ | ||
&& make && make install \ | ||
&& { find /usr/sbin/bird* -type f -executable -exec strip --strip-all "{}" +; } | ||
|
||
FROM ubuntu:24.04 | ||
|
||
RUN set -eux \ | ||
&& apt-get update -y \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
iproute2 \ | ||
libtinfo6 \ | ||
libreadline8 \ | ||
libssh-4 \ | ||
&& rm -rf /var/lib/apt/lists/* /var/log/* | ||
|
||
COPY --from=builder /usr/sbin/bird* /usr/sbin/ | ||
COPY --from=builder /etc/bird/ /etc/bird/ | ||
|
||
EXPOSE 179/tcp | ||
CMD ["bird", "-f", "-R"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Bird | ||
|
||
This Dockerfile is heavilly inspired by https://github.com/akafeng/docker-bird (Apache License 2.0). | ||
Thanks @akafeng! | ||
|
||
The biggest difference is the `BIRD_PROTOCOLS` arg which allow to define which protocols to use. | ||
You can use `all` as a default, but in this case alpha-released protocols like `bmp` won't be compiled. |