Skip to content

Commit

Permalink
Merge branch 'aklinkert-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
czerwonk committed Jan 13, 2022
2 parents cc2c06f + 9a40f61 commit c6dd0ae
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/docker_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on:
workflow_run:
workflows: ["Test"]
branches: [master]
types:
types:
- completed

name: Docker Build (latest)
Expand All @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check Out Repo
- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
Expand All @@ -24,6 +24,8 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true

- name: Extract repo name
id: extract_repo_name
Expand All @@ -38,6 +40,7 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.extract_repo_name.outputs.repo }}:latest
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 3 additions & 0 deletions .github/workflows/docker_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true

- name: Extract repo name
id: extract_repo_name
Expand All @@ -40,6 +42,7 @@ jobs:
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.extract_repo_name.outputs.repo }}:v${{ steps.extract_tag_name.outputs.tag }}
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ ADD . /go/ping_exporter/
WORKDIR /go/ping_exporter
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/bin/ping_exporter


FROM alpine:latest
ENV CONFIG_FILE "/config/config.yml"
ENV CMD_FLAGS ""

WORKDIR /app
COPY --from=builder /go/bin/ping_exporter .
RUN apk --no-cache add ca-certificates libcap && \
setcap cap_net_raw+ep /app/ping_exporter

CMD ./ping_exporter --config.path $CONFIG_FILE
CMD ./ping_exporter --config.path $CONFIG_FILE $CMD_FLAGS
EXPOSE 9427

0 comments on commit c6dd0ae

Please sign in to comment.