1+ # syntax=docker/dockerfile:1
12# Builder
2- FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.23 -bookworm AS builder
3+ FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.25 -bookworm AS builder
34
45LABEL org.opencontainers.image.source=https://github.com/ipfs/someguy
56LABEL org.opencontainers.image.documentation=https://github.com/ipfs/someguy#docker
@@ -8,17 +9,20 @@ LABEL org.opencontainers.image.licenses=MIT+APACHE_2.0
89
910ARG TARGETPLATFORM TARGETOS TARGETARCH
1011
11- ENV GOPATH /go
12- ENV SRC_PATH $GOPATH/src/github.com/ipfs/someguy
13- ENV GO111MODULE on
14- ENV GOPROXY https://proxy.golang.org
12+ ENV GOPATH= /go
13+ ENV SRC_PATH= $GOPATH/src/github.com/ipfs/someguy
14+ ENV GO111MODULE= on
15+ ENV GOPROXY= https://proxy.golang.org
1516
16- COPY go.* $SRC_PATH/
17+ COPY go.mod go.sum $SRC_PATH/
1718WORKDIR $SRC_PATH
18- RUN go mod download
19+ RUN --mount=type=cache,target=/go/pkg/mod \
20+ go mod download
1921
2022COPY . $SRC_PATH
21- RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o $GOPATH/bin/someguy
23+ RUN --mount=type=cache,target=/go/pkg/mod \
24+ --mount=type=cache,target=/root/.cache/go-build \
25+ CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o $GOPATH/bin/someguy
2226
2327# Runner
2428FROM debian:bookworm-slim
@@ -27,9 +31,9 @@ RUN apt-get update && \
2731 apt-get install --no-install-recommends -y tini ca-certificates curl && \
2832 rm -rf /var/lib/apt/lists/*
2933
30- ENV GOPATH /go
31- ENV SRC_PATH $GOPATH/src/github.com/ipfs/someguy
32- ENV DATA_PATH /data/someguy
34+ ENV GOPATH= /go
35+ ENV SRC_PATH= $GOPATH/src/github.com/ipfs/someguy
36+ ENV DATA_PATH= /data/someguy
3337
3438COPY --from=builder $GOPATH/bin/someguy /usr/local/bin/someguy
3539
0 commit comments