You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Dockerfile
+23-18Lines changed: 23 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,14 @@
2
2
3
3
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
4
4
#
5
-
# Generated on 2023-04-24T18:56:28Z by kres latest.
5
+
# Generated on 2023-05-22T18:49:58Z by kres latest.
6
6
7
7
ARG TOOLCHAIN
8
8
9
9
# runs markdownlint
10
-
FROM docker.io/node:20.0.0-alpine3.16 AS lint-markdown
10
+
FROM docker.io/node:20.2.0-alpine3.17 AS lint-markdown
11
11
WORKDIR /src
12
-
RUN npm i -g markdownlint-cli@0.33.0
12
+
RUN npm i -g markdownlint-cli@0.34.0
13
13
RUN npm i sentences-per-line@0.2.1
14
14
COPY .markdownlint.json .
15
15
COPY ./README.md ./README.md
@@ -29,17 +29,6 @@ ENV GO111MODULE on
29
29
ARG CGO_ENABLED
30
30
ENV CGO_ENABLED ${CGO_ENABLED}
31
31
ENV GOPATH /go
32
-
ARG GOLANGCILINT_VERSION
33
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCILINT_VERSION} \
34
-
&& mv /go/bin/golangci-lint /bin/golangci-lint
35
-
ARG GOFUMPT_VERSION
36
-
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
37
-
&& mv /go/bin/gofumpt /bin/gofumpt
38
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
39
-
&& mv /go/bin/govulncheck /bin/govulncheck
40
-
ARG GOIMPORTS_VERSION
41
-
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/tools/cmd/goimports@${GOIMPORTS_VERSION} \
42
-
&& mv /go/bin/goimports /bin/goimports
43
32
ARG PROTOBUF_GO_VERSION
44
33
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOBUF_GO_VERSION}
45
34
RUN mv /go/bin/protoc-gen-go /bin
@@ -55,12 +44,24 @@ RUN mv /go/bin/protoc-gen-go-vtproto /bin
55
44
ARG DEEPCOPY_VERSION
56
45
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/siderolabs/deep-copy@${DEEPCOPY_VERSION} \
57
46
&& mv /go/bin/deep-copy /bin/deep-copy
47
+
ARG GOLANGCILINT_VERSION
48
+
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCILINT_VERSION} \
49
+
&& mv /go/bin/golangci-lint /bin/golangci-lint
50
+
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/vuln/cmd/govulncheck@latest \
51
+
&& mv /go/bin/govulncheck /bin/govulncheck
52
+
ARG GOIMPORTS_VERSION
53
+
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg go install golang.org/x/tools/cmd/goimports@${GOIMPORTS_VERSION} \
54
+
&& mv /go/bin/goimports /bin/goimports
55
+
ARG GOFUMPT_VERSION
56
+
RUN go install mvdan.cc/gofumpt@${GOFUMPT_VERSION} \
57
+
&& mv /go/bin/gofumpt /bin/gofumpt
58
58
59
59
# tools and sources
60
60
FROM tools AS base
61
61
WORKDIR /src
62
-
COPY ./go.mod .
63
-
COPY ./go.sum .
62
+
COPY go.mod go.mod
63
+
COPY go.sum go.sum
64
+
RUN cd .
64
65
RUN --mount=type=cache,target=/go/pkg go mod download
65
66
RUN --mount=type=cache,target=/go/pkg go mod verify
66
67
COPY ./api ./api
@@ -88,25 +89,29 @@ RUN FILES="$(gofumpt -l .)" && test -z "${FILES}" || (echo -e "Source code is no
88
89
89
90
# runs goimports
90
91
FROM base AS lint-goimports
91
-
RUN FILES="$(goimports -l -local github.com/siderolabs/go-api-signature .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/siderolabs/go-api-signature .':\n${FILES}"; exit 1)
92
+
RUN FILES="$(goimports -l -local github.com/siderolabs/go-api-signature/ .)" && test -z "${FILES}" || (echo -e "Source code is not formatted with 'goimports -w -local github.com/siderolabs/go-api-signature/ .':\n${FILES}"; exit 1)
92
93
93
94
# runs golangci-lint
94
95
FROM base AS lint-golangci-lint
96
+
WORKDIR /src
95
97
COPY .golangci.yml .
96
98
ENV GOGC 50
97
99
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/root/.cache/golangci-lint --mount=type=cache,target=/go/pkg golangci-lint run --config .golangci.yml
98
100
99
101
# runs govulncheck
100
102
FROM base AS lint-govulncheck
103
+
WORKDIR /src
101
104
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg govulncheck ./...
102
105
103
106
# runs unit-tests with race detector
104
107
FROM base AS unit-tests-race
108
+
WORKDIR /src
105
109
ARG TESTPKGS
106
110
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg --mount=type=cache,target=/tmp CGO_ENABLED=1 go test -v -race -count 1 ${TESTPKGS}
107
111
108
112
# runs unit-tests
109
113
FROM base AS unit-tests-run
114
+
WORKDIR /src
110
115
ARG TESTPKGS
111
116
RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg --mount=type=cache,target=/tmp go test -v -covermode=atomic -coverprofile=coverage.txt -coverpkg=${TESTPKGS} -count 1 ${TESTPKGS}
@@ -117,6 +117,9 @@ target-%: ## Builds the specified target defined in the Dockerfile. The build r
117
117
local-%: ## Builds the specified target defined in the Dockerfile using the local output type. The build result will be output to the specified local destination.
0 commit comments