Merge pull request 'more-build-caching' (#98) from more-build-caching into master
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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:
@@ -4,8 +4,19 @@
|
|||||||
commands:
|
commands:
|
||||||
- go test ./...
|
- go test ./...
|
||||||
volumes:
|
volumes:
|
||||||
- go_cache:/root/.cache/go-build
|
- go_build_cache:/root/.cache/go-build
|
||||||
|
- go_mod_cache:/go/pkg/mod
|
||||||
build:
|
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
|
image: docker
|
||||||
commands:
|
commands:
|
||||||
- apk add curl
|
- apk add curl
|
||||||
@@ -23,4 +34,5 @@
|
|||||||
branch: "master"
|
branch: "master"
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /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
|
||||||
|
|||||||
10
Dockerfile
10
Dockerfile
@@ -1,9 +1,3 @@
|
|||||||
FROM golang:1.26
|
FROM scratch
|
||||||
WORKDIR /src
|
COPY server ./
|
||||||
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 ./
|
|
||||||
CMD ["/server"]
|
CMD ["/server"]
|
||||||
Reference in New Issue
Block a user