Skip to content

Commit b5bdb25

Browse files
committed
Update Go Dockerfile to use a separate directory for caching
1 parent 0739f95 commit b5bdb25

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dockerfiles/go-1.22.Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ FROM golang:1.22-alpine
22

33
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="go.mod,go.sum"
44

5+
# By default, Go uses $HOME for GOCACHE. We need to override $HOME in some tests,
6+
# so let's ensure Go uses a different directory for caching.
7+
RUN mkdir -p /cache
8+
ENV GOCACHE=/cache
9+
510
WORKDIR /app
611

712
COPY go.mod go.sum ./

0 commit comments

Comments
 (0)