Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2021-03-31 Thread Andrew Walker
There are a couple ways I know of that you can do this. You can vendor or copy as you mention. Another approach is to create a "build" image that contains relevant credentials and a few `go env -w` directives to set up your build environment, which you build separately and derive other

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-15 Thread gregoryh
On Monday, January 14, 2019 at 4:52:37 PM UTC-8, Philip Nelson wrote: > > You can't copy from outside the context but you can volume mount it. In my > docker-compose.yml I have the following for a golang:1.11-alpine image > derivative: > > ``` > volumes: > - ${GOPATH}:/go > ``` > >

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread Philip Nelson
You can't copy from outside the context but you can volume mount it. In my docker-compose.yml I have the following for a golang:1.11-alpine image derivative: ``` volumes: - ${GOPATH}:/go ``` Phil I `RUN go mod download` before copying my source On Monday, January 14, 2019 at 8:49:05

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread Michael Poindexter
Just as a data point, at my work we're using the `go mod vendor` / `go build -mod=vendor` route for exactly the reasons you mention, and it works quite well. On Mon, Jan 14, 2019 at 8:49 AM wrote: > On Saturday, January 12, 2019 at 5:57:19 PM UTC-8, Sam Whited wrote: >> >> On Fri, Jan 11, 2019,

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-14 Thread gregoryh
On Saturday, January 12, 2019 at 5:57:19 PM UTC-8, Sam Whited wrote: > > On Fri, Jan 11, 2019, at 23:03, greg...@unity3d.com wrote: > > But now, I don't know how I can essentially copy the mod cache (or > > whatever the right term is) like I'd have copied the vendor directory. > > If you're

Re: [go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-12 Thread Sam Whited
On Fri, Jan 11, 2019, at 23:03, grego...@unity3d.com wrote: > But now, I don't know how I can essentially copy the mod cache (or > whatever the right term is) like I'd have copied the vendor directory. If you're suggesting that you already have the module cached on the machine that builds your

[go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-11 Thread Tamás Gulácsi
Use the vendor directory, or use a replace directive with a relative path. -- 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

[go-nuts] Transferring host's go-mod-download cache into docker container

2019-01-11 Thread gregoryh
Hi, I'm converting over a project from using dep to using mod and I think I have a pretty good handle on it all... but: This particular project has a dependency that is hosted on an internal git server that requires credentials. In the past it wasn't an issue because we'd just copy the vendor