Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit e821c36

Browse files
committed
build: upgrade to Go 1.19 & build tweaks
* Use Go 1.19 and latest golangci-lint * Bump support libraries (i.e. everything that does not touch cloud / Compose) * Dockerfile caching/performance improvements Signed-off-by: Milas Bowman <[email protected]>
1 parent 7a57a33 commit e821c36

File tree

15 files changed

+181
-160
lines changed

15 files changed

+181
-160
lines changed

.github/workflows/aci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: 1.18
10+
GO_VERSION: 1.19
1111

1212
jobs:
1313
check-optional-tests:

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: 1.18
10+
GO_VERSION: 1.19
1111

1212
jobs:
1313
lint:

.github/workflows/cli-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
default: 'true'
1313

1414
env:
15-
GO_VERSION: 1.18
15+
GO_VERSION: 1.19
1616

1717
jobs:
1818
release:

.github/workflows/ecs-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: 1.18
10+
GO_VERSION: 1.19
1111

1212
jobs:
1313
check-optional-tests:

.github/workflows/kube-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: 1.18
10+
GO_VERSION: 1.19
1111

1212
jobs:
1313
check-optional-tests:

.github/workflows/windows-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
pull_request:
88

99
env:
10-
GO_VERSION: 1.18
10+
GO_VERSION: 1.19
1111

1212
jobs:
1313
check-optional-tests:

Dockerfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# syntax=docker/dockerfile:1.2
2-
1+
# syntax=docker/dockerfile:1
32

43
# Copyright 2020 Docker Compose CLI authors
54

@@ -15,8 +14,8 @@
1514
# See the License for the specific language governing permissions and
1615
# limitations under the License.
1716

18-
ARG GO_VERSION=1.18-alpine
19-
ARG GOLANGCI_LINT_VERSION=v1.45.2-alpine
17+
ARG GO_VERSION=1.19-alpine
18+
ARG GOLANGCI_LINT_VERSION=v1.50.1-alpine
2019
ARG PROTOC_GEN_GO_VERSION=v1.5.2
2120

2221
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
@@ -43,7 +42,7 @@ FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION} AS lint-base
4342
FROM base AS lint
4443
ENV GOFLAGS="-buildvcs=false"
4544
ENV CGO_ENABLED=0
46-
COPY --from=lint-base /usr/bin/golangci-lint /usr/bin/golangci-lint
45+
COPY --from=lint-base --link /usr/bin/golangci-lint /usr/bin/golangci-lint
4746
ARG BUILD_TAGS
4847
ARG GIT_TAG
4948
RUN --mount=target=. \
@@ -89,13 +88,13 @@ RUN --mount=target=. \
8988
make BINARY=/out/docker -f builder.Makefile cross
9089

9190
FROM scratch AS protos
92-
COPY --from=make-protos /compose-cli/cli/server/protos .
91+
COPY --from=make-protos --link /compose-cli/cli/server/protos .
9392

9493
FROM scratch AS cli
95-
COPY --from=make-cli /out/* .
94+
COPY --from=make-cli --link /out/* .
9695

9796
FROM scratch AS cross
98-
COPY --from=make-cross /out/* .
97+
COPY --from=make-cross --link /out/* .
9998

10099
FROM base AS test
101100
ENV CGO_ENABLED=0
@@ -120,9 +119,11 @@ RUN --mount=type=cache,target=/go/pkg/mod \
120119
go mod tidy
121120

122121
FROM scratch AS go-mod-tidy
123-
COPY --from=make-go-mod-tidy /compose-cli/go.mod .
124-
COPY --from=make-go-mod-tidy /compose-cli/go.sum .
122+
COPY --from=make-go-mod-tidy --link /compose-cli/go.mod .
123+
COPY --from=make-go-mod-tidy --link /compose-cli/go.sum .
125124

126125
FROM base AS check-go-mod
127126
COPY . .
128-
RUN make -f builder.Makefile check-go-mod
127+
RUN --mount=type=cache,target=/go/pkg/mod \
128+
--mount=type=cache,target=/root/.cache/go-build \
129+
make -f builder.Makefile check-go-mod

aci/e2e/aci-demo/web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
# BUILD
15-
FROM golang:1.18-alpine AS build
15+
FROM golang:1.19-alpine AS build
1616
COPY dispatcher.go .
1717
RUN mkdir -p /out && go build -o /out/dispatcher dispatcher.go
1818

aci/e2e/aci_secrets_resources/web/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717

18-
FROM golang:1.18-alpine AS build
18+
FROM golang:1.19-alpine AS build
1919
COPY main.go .
2020
RUN --mount=type=cache,target=/go/pkg/mod \
2121
go build -trimpath -ldflags="-s -w" -o server main.go

aci/etchosts/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang:1.18 AS builder
15+
FROM golang:1.19 AS builder
1616
WORKDIR $GOPATH/src/github.com/docker/compose-cli/aci/etchosts
1717
COPY . .
1818
RUN GO111MODULE=auto CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/hosts main/main.go

0 commit comments

Comments
 (0)