Skip to content

Commit

Permalink
Merge pull request #3 from julienduchesne/docker-image
Browse files Browse the repository at this point in the history
Add docker image and go modules
  • Loading branch information
jackhammer2k authored Jul 8, 2021
2 parents 92fd665 + 916d20c commit b937fd1
Show file tree
Hide file tree
Showing 4 changed files with 609 additions and 3 deletions.
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.16 as builder

WORKDIR /app

COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -installsuffix 'static' .

RUN echo 'nobody:x:65534:65534:nobody:/:' > /etc/passwd && \
echo 'nobody:x:65534:' > /etc/group


FROM scratch

COPY --from=builder /app/alertmanager-webhook-logger /app/alertmanager-webhook-logger
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group

# Perform any further action as an unprivileged user.
USER nobody:nobody

ENTRYPOINT ["/app/alertmanager-webhook-logger"]
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ Command line flags:

## Build

go get -u github.com/tomtom-international/alertmanager-webhook-logger
cd $env:GOPATH/src/github.com/tomtom-international/alertmanager-webhook-logger
go build

## Test

go get -u github.com/kami-zh/go-capturer
go test

## License
Expand Down
9 changes: 9 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module github.com/tomtom-international/alertmanager-webhook-logger

go 1.16

require (
github.com/go-kit/kit v0.10.0
github.com/kami-zh/go-capturer v0.0.0-20171211120116-e492ea43421d
github.com/prometheus/alertmanager v0.21.0
)
Loading

0 comments on commit b937fd1

Please sign in to comment.