Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
FROM golang:1.12 AS build-env
FROM docker.io/golang:1.17.5 AS build-env
ENV CGO_ENABLED=0
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod tidy
ENV GOLANGCI_LINT_VERSION=v1.22.0
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
| sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION
# ENV GOLANGCI_LINT_VERSION=v1.43.0
# RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
# | sh -s -- -b $(go env GOPATH)/bin $GOLANGCI_LINT_VERSION

COPY . .
RUN golangci-lint run --timeout 30m
# RUN golangci-lint run --timeout 30m
RUN go build ./... && go test ./... && go install ./...

FROM alpine:3.6
RUN apk add --update ca-certificates git openssh-client \
&& addgroup -g 1000 user \
&& adduser -u 1000 -D user -G user \
&& ssh-keyscan github.com > /etc/ssh/ssh_known_hosts
USER user
FROM scratch
COPY --from=0 /go/bin/* /usr/bin/
ENTRYPOINT [ "webhook" ]