-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rishabh Gupta <r.g.gupta@outlook.com>
- Loading branch information
Showing
5 changed files
with
111 additions
and
81 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
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.10.4-alpine as builder | ||
RUN mkdir -p /go/src/github.com/zeerorg/cron-connector | ||
WORKDIR /go/src/github.com/zeerorg/cron-connector | ||
|
||
COPY vendor vendor | ||
COPY types types | ||
COPY main_test.go . | ||
COPY main.go . | ||
|
||
# Run a gofmt and exclude all vendored code. | ||
RUN test -z "$(gofmt -l $(find . -type f -name '*.go' -not -path "./vendor/*"))" | ||
|
||
RUN go test -v ./... | ||
|
||
ARG TARGETARCH | ||
ENV GOARCH=$TARGETARCH | ||
|
||
# Stripping via -ldflags "-s -w" | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH go build -a -ldflags "-s -w" -installsuffix cgo -o ./connector | ||
|
||
FROM alpine:3.8 | ||
|
||
RUN addgroup -S app \ | ||
&& adduser -S -g app app | ||
|
||
WORKDIR /home/app | ||
|
||
COPY --from=builder /go/src/github.com/zeerorg/cron-connector/connector . | ||
|
||
RUN chown -R app:app ./ | ||
|
||
USER app | ||
|
||
CMD ["./connector"] |
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
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