Mopsican
How to find Service ID - Docker Cache Mounts
ok,
it's just i need to use
RUN --mount=type=cache,id=s/<service_id>/root/cache/go-build,target=/root/.cache/go-build \
apk --update add \
ca-certificates \
tzdata \
&& \
update-ca-certificates
and
RUN --mount=type=cache,id=s/<service_id>/root/cache/go-build,target=/root/.cache/go-build \
--mount=type=bind,target=. \
CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin/server ./
as well
28 replies
How to find Service ID - Docker Cache Mounts
It's now throwing: Invalid cache mounts
However, it still works locally.
full example
RUN --mount=type=cache,id=s/<service_id>/root/cache/go-build,target=/root/.cache/go-build \
--mount=type=bind,source=go.sum,target=go.sum \
--mount=type=bind,source=go.mod,target=go.mod \
go mod download -x
do i need to change the targets?
28 replies