2
1
Fork 0

fix go mod tidy permission issues

main^2
Sebastian Steger 2025-08-20 09:18:14 +00:00
parent 94eb0329bd
commit 3b64985275
2 changed files with 14 additions and 6 deletions

View File

@ -1,14 +1,21 @@
FROM golang:1.25 FROM golang:1.25
RUN apt-get update && apt-get install -y build-essential 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 github.com/go-delve/delve/cmd/dlv@latest
RUN go install -v golang.org/x/tools/gopls@latest #RUN go install github.com/cweill/gotests/gotests@v1.6.0
RUN go install -v golang.org/x/tools/cmd/goimports@latest #RUN go install golang.org/x/tools/gopls@latest
RUN go install -v honnef.co/go/tools/cmd/staticcheck@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 USERNAME=developer
ARG USER_UID=1000 ARG USER_UID=1000
ARG USER_GID=$USER_UID ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME RUN groupadd --gid $USER_GID $USERNAME && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
USER $USERNAME USER $USERNAME

View File

@ -3,6 +3,7 @@
"build": { "build": {
"dockerfile": "Dockerfile" "dockerfile": "Dockerfile"
}, },
"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": { "customizations": {
"vscode": { "extensions": [ "vscode": { "extensions": [
"golang.go", "golang.go",