diff --git a/Dockerfile b/Dockerfile index c12a63c2c..ba8fd5fbc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,8 +41,11 @@ RUN curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" \ ENV PATH="/usr/local/go/bin:${PATH}" ENV GOPATH="/go" -# Pre-install common Go tools that need a Go toolchain. -RUN go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest && \ +# Pre-install common Go tools. Use pre-built binaries to avoid +# compiling from source (golangci-lint is a large CGO build). +ARG GOLANGCI_LINT_VERSION=v2.12.2 +RUN curl -fsSL "https://github.com/golangci/golangci-lint/releases/download/${GOLANGCI_LINT_VERSION}/golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64.tar.gz" \ + | tar -xz -C /usr/local/bin --strip-components=1 "golangci-lint-${GOLANGCI_LINT_VERSION}-linux-amd64/golangci-lint" && \ go install mvdan.cc/gofumpt@latest && \ rm -rf /go/pkg/mod/cache diff --git a/docker-compose.yml b/docker-compose.yml index 8e88c0a44..85f672afc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,7 @@ services: - nats_data:/data restart: unless-stopped healthcheck: - test: ["CMD", "nats", "server", "check", "-s", "nats://localhost:4222"] + test: ["CMD", "wget", "-q", "-O", "-", "http://localhost:8222/healthz"] interval: 10s timeout: 5s retries: 5