diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 92ea913..c4ed85f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,16 +31,18 @@ jobs: with: images: ${{ env.DOCKERHUB_SLUG }} tag-edge: true - tag-match: (.*)-RC + tag-match: (.*)-r tag-match-group: 1 + label-custom: | + org.opencontainers.image.title=LibreNMS + org.opencontainers.image.description=Fully featured network monitoring system + org.opencontainers.image.vendor=CrazyMax - name: Set up QEMU uses: docker/setup-qemu-action@v1 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - with: - buildkitd-flags: "--debug" - name: Login to DockerHub if: github.event_name != 'pull_request' @@ -50,18 +52,13 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build - uses: docker/build-push-action@v2 + uses: docker/bake-action@v1 with: - context: . - file: ./Dockerfile - platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/386,linux/ppc64le,linux/s390x + files: | + ./docker-bake.hcl + ${{ steps.docker_meta.outputs.bake-file }} + targets: image-all push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.docker_meta.outputs.tags }} - labels: | - ${{ steps.docker_meta.outputs.labels }} - org.opencontainers.image.title=LibreNMS - org.opencontainers.image.description=Fully featured network monitoring system - org.opencontainers.image.vendor=CrazyMax - name: Check manifest if: github.event_name != 'pull_request' diff --git a/README.md b/README.md index 0d0d73f..fdf0734 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,19 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other * [msmtpd SMTP relay](https://github.com/crazy-max/docker-msmtpd) image to send emails * [MariaDB](https://github.com/docker-library/mariadb) image as database instance +## Build locally + +```shell +git clone https://github.com/librenms/docker.git docker-librenms +cd docker-librenms + +# Build image and output to docker (default) +docker buildx bake + +# Build multi-platform image +docker buildx bake image-all +``` + ## Multi-platform image Following platforms for this image are available: @@ -74,7 +87,10 @@ Image: librenms/librenms:latest ## How can I help? -All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket: +All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star +:star2: the project, or to raise issues :speech_balloon: You can also support this project by +[**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a +[Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket: Thanks again for your support, it is much appreciated! :pray: diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000..d820568 --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,35 @@ +variable "DEFAULT_TAG" { + default = "librenms:local" +} + +// Special target: https://github.com/crazy-max/ghaction-docker-meta#bake-definition +target "ghaction-docker-meta" { + tags = ["${DEFAULT_TAG}"] +} + +// Default target if none specified +group "default" { + targets = ["image-local"] +} + +target "image" { + inherits = ["ghaction-docker-meta"] +} + +target "image-local" { + inherits = ["image"] + output = ["type=docker"] +} + +target "image-all" { + inherits = ["image"] + platforms = [ + "linux/amd64", + "linux/arm/v6", + "linux/arm/v7", + "linux/arm64", + "linux/386", + "linux/ppc64le", + "linux/s390x" + ] +}