Got it to work doing this: docker run --rm -v "$PWD":/go/src/myproject/apps/app1 -w /go/src/myprojects/apps/app1 golang:latest go build -o app1
This builds the binary in the docker container and leaves it in the host directory (so I don't need to have Go installed on the host) - On Tuesday, September 20, 2016 at 11:12:16 AM UTC-4, sc28 wrote: > > I have a application structure as follows in my GoPath: > > --/ myproject > | > |-- apps > |-- app1 > |-- main.go > |-- app2 > |-- main.go > |-- appN > |-- main.go > |-- libs > |-- myCommonPackage > |-- gofile1.go > |-- gofile2.go > > > If I go into each "app" and execute the following: > > >govendor init > >govendor add +external +local > > I get the external (github) packages and my local (libs/myCommonPackage) > vendored int he /vendor folder and everything builds fine locally. > > > Now I'm trying to use docker to build the apps, using the following > command: > > docker run --rm -it -v "$PWD":/usr/src/app -w /usr/src/app > golang:1.7 go get (the container's GOPATH is at /go/app) > > > The goal here is to allow my DevOps guy to pull the source and build the > executable inside a docker container (containing GOlang). > > The build inside the 'build' container fails on my local package (all the > vendored github/golang.org) are found, but it errors on the > /libs/myCommonPackage saying it cannot be found. > > > What is a better structure that would allow me to use 'local' packages > that are vendored, but that could be found by the docker build container? > > > > > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.