Skip to content

Commit e3c1c1e

Browse files
Fix go mod download cache permissions (#5309)
* Fix go mod download cache permissions * Change permissions a different way * Better approach
1 parent ba5d856 commit e3c1c1e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.devcontainer/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ COPY v2/tools/generator/go.mod v2/tools/generator/go.sum /tmp/mod-download/v2/to
3838
# mangle-test-json (standalone, no replace directives)
3939
COPY v2/tools/mangle-test-json/go.mod v2/tools/mangle-test-json/go.sum /tmp/mod-download/v2/tools/mangle-test-json/
4040
# Now do all the downloads
41-
RUN find /tmp/mod-download -name go.mod -execdir pwd \; -execdir go mod download \;
41+
ENV GOFLAGS=-modcacherw
42+
RUN mkdir -p /go/pkg/mod && \
43+
find /tmp/mod-download -name go.mod -execdir pwd \; -execdir go mod download \; && \
44+
chmod -R a+rwX /go/pkg/mod
4245

4346
# Clean up temporary module download directory
4447
RUN rm -rf /tmp/mod-download

0 commit comments

Comments
 (0)