mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 23:53:28 +00:00
Merge pull request #12439 from opensourcerouting/feature/docker_build_and_push_latest
docker: Build docker images with Github Actions
This commit is contained in:
commit
153cc5adb8
51
.github/workflows/docker-daily-master.yml
vendored
Normal file
51
.github/workflows/docker-daily-master.yml
vendored
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
name: Build daily 'master' images for Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '59 23 * * *'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker_daily_master:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Custom variables
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
# To package a specific git commit, the date of the commit gets
|
||||||
|
# appended to the latest release, e.g. 1.0.0_git20180204.
|
||||||
|
# This is the requirement by APKBUILD (abuild).
|
||||||
|
# More details: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference.
|
||||||
|
echo ::set-output name=date::$(date +'%Y%m%d')
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: master
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./docker/alpine/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/frr:master
|
||||||
|
build-args: PKGVER=${{ steps.vars.outputs.date }}
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
52
.github/workflows/docker-stable.yml
vendored
Normal file
52
.github/workflows/docker-stable.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
name: Build stable branch images for Docker
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'stable/**'
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker_daily_master:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Custom variables
|
||||||
|
id: vars
|
||||||
|
run: |
|
||||||
|
# To package a specific git commit, the date of the commit gets
|
||||||
|
# appended to the latest release, e.g. 1.0.0_git20180204.
|
||||||
|
# This is the requirement by APKBUILD (abuild).
|
||||||
|
# More details: https://wiki.alpinelinux.org/wiki/APKBUILD_Reference.
|
||||||
|
echo ::set-output name=date::$(date +'%Y%m%d')
|
||||||
|
# Get the real version specified in configure.ac file.
|
||||||
|
echo ::set-output name=frr_version::$(grep AC_INIT configure.ac | cut -d '[' -f3 | cut -d ']' -f 1)
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v3
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./docker/alpine/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: ${{ secrets.DOCKERHUB_USERNAME }}/frr:v${{ steps.vars.outputs.frr_version }}
|
||||||
|
build-args: PKGVER=${{ steps.vars.outputs.date }}
|
||||||
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
@ -1,7 +1,7 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
# Create a basic stage set up to build APKs
|
# Create a basic stage set up to build APKs
|
||||||
FROM alpine:3.16 as alpine-builder
|
FROM alpine:3.17 as alpine-builder
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
--update-cache \
|
--update-cache \
|
||||||
abuild \
|
abuild \
|
||||||
@ -13,7 +13,7 @@ RUN apk add \
|
|||||||
RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n'
|
RUN adduser -D -G abuild builder && su builder -c 'abuild-keygen -a -n'
|
||||||
|
|
||||||
# This stage builds a dist tarball from the source
|
# This stage builds a dist tarball from the source
|
||||||
FROM alpine:3.16 as source-builder
|
FROM alpine:3.17 as source-builder
|
||||||
|
|
||||||
RUN mkdir -p /src/alpine
|
RUN mkdir -p /src/alpine
|
||||||
COPY alpine/APKBUILD.in /src/alpine
|
COPY alpine/APKBUILD.in /src/alpine
|
||||||
@ -48,7 +48,7 @@ RUN cd /dist \
|
|||||||
&& abuild -r -P /pkgs/apk
|
&& abuild -r -P /pkgs/apk
|
||||||
|
|
||||||
# This stage installs frr from the apk
|
# This stage installs frr from the apk
|
||||||
FROM alpine:3.16
|
FROM alpine:3.17
|
||||||
RUN mkdir -p /pkgs/apk
|
RUN mkdir -p /pkgs/apk
|
||||||
COPY --from=alpine-apk-builder /pkgs/apk/ /pkgs/apk/
|
COPY --from=alpine-apk-builder /pkgs/apk/ /pkgs/apk/
|
||||||
RUN apk add \
|
RUN apk add \
|
||||||
|
Loading…
Reference in New Issue
Block a user