Skip to content

failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied #41

@liskicious

Description

@liskicious

I tried to follow docs, but I get an error with the .cache folder. It seems to use /.cache and not ./.cache ?

➜  server mkdir -p ./.cache/pkg;

➜  server docker run -it \
  -u $(id -u) \           
  -v "$(pwd):/go/src/app" \
  -v "$(pwd)/.cache/pkg:/go/pkg" \
  -w /go/src/app \
  zephinzer/godev:latest \
  godev init
/go/src/app 
Nov02/16:46| [main] godev has started
odev> initialise git repository at '/go/src/app'? [y/N]: y
odev> sure thing
Initialized empty Git repository in /go/src/app/.git/
odev> seed a .gitignore? [y/N]: y
odev> sure thing
odev> seed a go.mod? [y/N]: y
odev> sure thing
odev> seed a main.go? [y/N]: y
odev> sure thing
odev> seed a Dockerfile? [y/N]: y
odev> sure thing
odev> seed a .dockerignore? [y/N]: y
odev> sure thing
odev> seed a Makefile? [y/N]: y
odev> sure thing
Nov02/16:46| [main] godev has ended
➜  server git:(master) ✗ docker run -it \
  -u $(id -u) \
  -v "$(pwd):/go/src/app" \
  -v "$(pwd)/.cache/pkg:/go/pkg" \
  -w /go/src/app \
  zephinzer/godev:latest \
  godev     
Nov02/16:46| [main] godev has started
Nov02/16:46| [main] working dir : '/go/src/app'
Nov02/16:46| [main] watching dir: '/go/src/app'
Nov02/16:46| [command/go] 'mod', 'vendor'
► ─────────────────────────────────────────── pid:12 id:20bcdb ►
go: modules disabled inside GOPATH/src by GO111MODULE=auto; see 'go help modules'
Nov02/16:46| [command/go] 
■ ─────────────────────────────────────────── pid:12 id:20bcdb ■
Nov02/16:46| [run/1/1/3]] command[20bcdb] exited with: exit status 1
Nov02/16:46| [command/go] 'build', '-o', '/go/src/app/bin/app'
► ─────────────────────────────────────────── pid:21 id:c6be74 ►
failed to initialize build cache at /.cache/go-build: mkdir /.cache: permission denied
Nov02/16:46| [command/go] 
■ ─────────────────────────────────────────── pid:21 id:c6be74 ■
Nov02/16:46| [run/1/2/3]] command[c6be74] exited with: exit status 1
Nov02/16:46| [run/1/3/3]] application at '/go/src/app/bin/app' could not be found

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions