caketop / python-starlark-go

🐍 Python bindings for starlark-go 🐍
https://python-starlark-go.readthedocs.io/
Apache License 2.0
20 stars 7 forks source link

Fix permissions in devcontainer? #177

Closed tadamcz closed 1 year ago

tadamcz commented 1 year ago

This is my first time using devcontainers and I rarely use Visual Studio Code, so I might be doing something wrong. Feel free to close this PR.

Problem

When I tried to open this repo in a dev container in Visual Studio Code, I got lots of permission errors.

For example, if I try to build the current Go package or Go workspace:

Starting‘ building the current workspace at /workspaces/python-starlark-go
/workspaces/python-starlark-go>Finished running tool: /opt/go/bin/go build
go: could not create module cache: mkdir /home/builder/go/pkg: permission denied
go: could not create module cache: mkdir /home/builder/go/pkg: permission denied
Starting building the current package at /workspaces/python-starlark-go
/workspaces/python-starlark-go>Finished running tool: /opt/go/bin/go build -o /tmp/vscode-gosVaJUu/go-code-check .
go: could not create module cache: mkdir /home/builder/go/pkg: permission denied
go: could not create module cache: mkdir /home/builder/go/pkg: permission denied
go: could not create module cache: mkdir /home/builder/go/pkg: permission denied

I also get errors to do with shellcheck and mcfly whenever I run any command in the terminal.

Solution

I made these changes to the Dockerfile by trial and error. It seems to work for me now, e.g.:

Starting building the current package at /workspaces/python-starlark-go
/workspaces/python-starlark-go>Finished running tool: /opt/go/bin/go build -o /tmp/vscode-goL28DLO/go-code-check .
jordemort commented 1 year ago

This looks good to me, thanks