fix(docker): bump builder to Go 1.26, download sqlc binary, fix test-runner Go version
The builder stage was previously bumped to Go 1.26 but the test-runner stage remained on Go 1.25, causing 'go.mod requires go >= 1.26.0' errors during test execution. Go 1.26 introduced stricter validation of replace directives in dependency go.mod files, which broke 'go install sqlc@latest' (sqlc v1.31.0 has replace directives). Replace go install with a direct binary download from GitHub releases, matching the existing kepubify download pattern. Bump test-runner from golang:1.25-alpine to golang:1.26-alpine to match the go.mod requirement.
This commit is contained in:
+5
-3
@@ -1,5 +1,5 @@
|
||||
# Build stage
|
||||
FROM golang:1.25-alpine AS builder
|
||||
FROM golang:1.26-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -7,8 +7,10 @@ WORKDIR /app
|
||||
RUN apk add --no-cache nodejs npm curl git
|
||||
|
||||
# Install Go tools (cached well)
|
||||
RUN wget -O /tmp/sqlc.tar.gz https://github.com/sqlc-dev/sqlc/releases/download/v1.31.0/sqlc_1.31.0_linux_amd64.tar.gz && \
|
||||
tar -xzf /tmp/sqlc.tar.gz -C /usr/local/bin sqlc && \
|
||||
rm /tmp/sqlc.tar.gz
|
||||
RUN --mount=type=cache,target=/root/go/pkg/mod \
|
||||
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest && \
|
||||
go install github.com/a-h/templ/cmd/templ@latest
|
||||
|
||||
# Copy package files and install npm dependencies (cached unless package.json changes)
|
||||
@@ -38,7 +40,7 @@ RUN --mount=type=cache,target=/root/go/pkg/mod \
|
||||
|
||||
# Test runner stage - includes Go runtime and test dependencies
|
||||
# This stage is ONLY used for running tests, never deployed to production
|
||||
FROM golang:1.25-alpine AS test-runner
|
||||
FROM golang:1.26-alpine AS test-runner
|
||||
|
||||
RUN apk --no-cache add ca-certificates curl
|
||||
|
||||
|
||||
Reference in New Issue
Block a user