Merge pull request 'more-build-caching' (#98) from more-build-caching into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Reviewed-on: #98
This commit was merged in pull request #98.
This commit is contained in:
2026-02-14 20:56:49 +00:00
2 changed files with 16 additions and 10 deletions

View File

@@ -4,8 +4,19 @@
commands:
- go test ./...
volumes:
- go_cache:/root/.cache/go-build
- go_build_cache:/root/.cache/go-build
- go_mod_cache:/go/pkg/mod
build:
image: golang:1.26
environment:
CGO_ENABLED: 0
GOOS: linux
commands:
- go build -o server ./cmd/serve
volumes:
- go_build_cache:/root/.cache/go-build
- go_mod_cache:/go/pkg/mod
container:
image: docker
commands:
- apk add curl
@@ -23,4 +34,5 @@
branch: "master"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- go_cache:/root/.cache/go-build
- go_build_cache:/root/.cache/go-build
- go_mod_cache:/go/pkg/mod

View File

@@ -1,9 +1,3 @@
FROM golang:1.26
WORKDIR /src
COPY . ./
RUN CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/serve
FROM scratch
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=0 /src/server ./
COPY server ./
CMD ["/server"]