-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch to use go module, fmt, docker changes, go 1.14 (#5)
* run gofmt * Switch to use go module, fmt, docker changes
- Loading branch information
1 parent
49ad175
commit 4a8326c
Showing
5 changed files
with
290 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
* | ||
!main.go | ||
!go.mod | ||
!go.sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
FROM golang:1.12.1 | ||
WORKDIR /go/src/github.com/deliveryhero/k8s-event-logger | ||
COPY main.go . | ||
RUN go get -d -v ./... | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . | ||
FROM golang:1.14.0 as builder | ||
WORKDIR /go/src/github.com/max-rocket-internet/k8s-event-logger | ||
COPY . . | ||
RUN go get | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o k8s-event-logger | ||
RUN adduser --disabled-login --no-create-home --disabled-password --system --uid 101 non-root | ||
|
||
FROM alpine:3.9.3 | ||
RUN apk --no-cache add ca-certificates | ||
WORKDIR / | ||
COPY --from=0 /go/src/github.com/deliveryhero/k8s-event-logger/main k8s-event-logger | ||
USER 101 | ||
RUN addgroup -S non-root && adduser -S -G non-root non-root | ||
USER non-root | ||
ENV USER non-root | ||
COPY --from=builder /go/src/github.com/max-rocket-internet/k8s-event-logger/k8s-event-logger k8s-event-logger | ||
CMD ["/k8s-event-logger"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module github.com/max-rocket-internet/k8s-event-logger | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/imdario/mergo v0.3.9 // indirect | ||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect | ||
golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1 // indirect | ||
k8s.io/api v0.18.2 | ||
k8s.io/apimachinery v0.18.2 | ||
k8s.io/client-go v0.18.2 | ||
k8s.io/utils v0.0.0-20200414100711-2df71ebbae66 // indirect | ||
) |
Oops, something went wrong.