Run build with current user #1500
-
I have a golang container defined as follow: containers:
build-env:
build_directory: ./.batect/golang-build-env
volumes:
- local: .
container: /app
options: cached
- type: cache
name: go-cache
container: /go
working_directory: /app
environment:
GOCACHE: /go/cache
run_as_current_user:
enabled: true
home_directory: /home/container-user
When I run a task in this container that requires Go to get external dependencies, it got following error:
As I can see, this error is because:
What's your recommendation in this case? Ideally I would like to have access to current user uid/gid during build process so that I can do Minimum repo to reproduce the issue: https://github.com/dnguyenzd/go-batect-permission |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What happens if you make |
Beta Was this translation helpful? Give feedback.
What happens if you make
/go/pkg
world-writable in your Dockerfile? (something likechmod -R a+rwx /go
)