Skip to content

Commit

Permalink
Added docker build files
Browse files Browse the repository at this point in the history
  • Loading branch information
akharlamov committed Mar 20, 2022
1 parent 3067a33 commit 5f2581b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM alpine:3.14 as builder
ARG COMMIT=feature/cilium-compatibility-patch

RUN apk add alpine-sdk build-base autoconf readline-dev bison flex ncurses-dev\
libssh linux-headers

RUN git clone --depth 1 --branch ${COMMIT} https://github.com/tailify/bird
WORKDIR bird

RUN autoreconf --install

RUN CFLAGS="-fcommon" ./configure --prefix=/usr --sysconfdir=/etc --runstatedir=/run

RUN make -j && \
make install

FROM alpine:3.14

LABEL "org.opencontainers.image.source"="https://github.com/tailify/bird"

ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apk add --no-cache readline ncurses libssh bash

COPY --from=builder /usr/sbin/bird* /usr/sbin/

ENTRYPOINT /usr/sbin/bird -f

11 changes: 11 additions & 0 deletions build-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -x -e

tag=$1
git tag -f "$tag"
git push -f origin "$tag"

image_id="ghcr.io/tailify/bird:$tag"
docker build -t "$image_id" --build-arg COMMIT=$tag .
docker push "$image_id"

0 comments on commit 5f2581b

Please sign in to comment.