Skip to content

Commit

Permalink
Merge branch 'master' of github.com:neuroforgede/docker-engine-events…
Browse files Browse the repository at this point in the history
…-exporter
  • Loading branch information
s4ke committed Jan 21, 2023
2 parents e100777 + 0e1de06 commit bdca6aa
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 10 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Docker

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ "master" ]
# Publish semver tags as releases.
tags: [ '*.*.*' ]
pull_request:
branches: [ "master" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@165fe681b849eec43aaa64d786b9ec53e690475f

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@3da7dc6e2b31f99ef2cb9fb4c50fb0971e0d0139
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@37abcedcc1da61a57767b7588cb9d03eb57e28b3
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ version: "3.8"

services:
docker-engine-events-exporter:
image: neuroforgede/docker-engine-events-exporter:0.1
image: ghcr.io/neuroforgede/docker-engine-events-exporter:0.1.0
networks:
- net
environment:
Expand Down Expand Up @@ -55,7 +55,7 @@ for example about containers with bad exit codes:
```yaml
- alert: Container (Swarm) died/is dying with exit code other than 0
expr: count by (container_attributes_com_docker_swarm_service_name, container_attributes_exitcode, status) (
expr: count by (docker_hostname, container_attributes_com_docker_swarm_service_name, container_attributes_exitcode, status) (
(
docker_events_container_total{status=~"die|.*oom.*|.*kill.*", container_attributes_exitcode != "0", container_attributes_exitcode != "" }
unless
Expand Down
8 changes: 0 additions & 8 deletions build.sh

This file was deleted.

0 comments on commit bdca6aa

Please sign in to comment.