From 340fe289c61223c5e40092759f5529d275e1f446 Mon Sep 17 00:00:00 2001 From: Sebastian Steger Date: Wed, 20 Aug 2025 09:18:14 +0000 Subject: [PATCH] fix go mod tidy permission issues --- go/.devcontainer/Dockerfile | 17 ++++++++++++----- go/.devcontainer/devcontainer.json | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/go/.devcontainer/Dockerfile b/go/.devcontainer/Dockerfile index 506077c..206f58f 100644 --- a/go/.devcontainer/Dockerfile +++ b/go/.devcontainer/Dockerfile @@ -1,14 +1,21 @@ FROM golang:1.25 RUN apt-get update && apt-get install -y build-essential -RUN go install github.com/go-delve/delve/cmd/dlv@latest -RUN go install -v github.com/cweill/gotests/gotests@v1.6.0 -RUN go install -v golang.org/x/tools/gopls@latest -RUN go install -v golang.org/x/tools/cmd/goimports@latest -RUN go install -v honnef.co/go/tools/cmd/staticcheck@latest + +#RUN go install github.com/go-delve/delve/cmd/dlv@latest +#RUN go install github.com/cweill/gotests/gotests@v1.6.0 +#RUN go install golang.org/x/tools/gopls@latest +#RUN go install golang.org/x/tools/cmd/goimports@latest +#RUN go install honnef.co/go/tools/cmd/staticcheck@latest + +# allow all users to add go packages in that container +#RUN mkdir -p /go/pkg && chmod -R a+rwx /go/pkg +#RUN chmod -R a+rwx /go/pkg/mod /go/pkg/sumdb +#RUN chmod -R a+rwx /go/pkg/mod/github.com ARG USERNAME=developer ARG USER_UID=1000 ARG USER_GID=$USER_UID RUN groupadd --gid $USER_GID $USERNAME && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME USER $USERNAME + diff --git a/go/.devcontainer/devcontainer.json b/go/.devcontainer/devcontainer.json index 6dae661..3f36777 100644 --- a/go/.devcontainer/devcontainer.json +++ b/go/.devcontainer/devcontainer.json @@ -3,7 +3,8 @@ "build": { "dockerfile": "Dockerfile" }, - "customizations": { + "postCreateCommand": "go install github.com/go-delve/delve/cmd/dlv@latest && go install github.com/cweill/gotests/gotests@v1.6.0 && go install golang.org/x/tools/gopls@latest && go install golang.org/x/tools/cmd/goimports@latest && go install honnef.co/go/tools/cmd/staticcheck@latest", + "customizations": { "vscode": { "extensions": [ "golang.go", "gruntfuggly.todo-tree"