Skip to content

Commit

Permalink
Switch to buildx bake
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Feb 2, 2021
1 parent 6cf2250 commit daa7f37
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 14 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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'
Expand Down
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:

Expand Down
35 changes: 35 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit daa7f37

Please sign in to comment.