I can get all my dependent packages when I do the following:
$ cd myrepo $ go get -d ./...
But what is the best way to do this in docker? I don't want all the repo's inside my docker-app so I'm searching for a way to execute this inside a docker container to some volume (or something like that) and reuse it.
I was thinking about something like. Dockerfile
FROM golang:1.8 WORKDIR /app ADD ./src
$ docker build -t myapp . $ docker run myapp go get -d ./...
How can I reuse the dependencies without pulling/downloading them every time? I want them in a sort of volume. I know docker volumes a bit but I don't know how to use it in this case.