gogo-micro

How to freeze micro version with dependencies?


I want to build a docker image with a fixed version of micro and go dependencies. I plan to do it with dep:

git checkout git@github.com:micro/micro.git
dep ensure
git add Gopkg.toml
git add Gopkg.lock

# Build micro
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-w' -i -o micro ./main.go 

# Build docker image
...

So, my question is does it the best solution to build consistent micro docker image?


Solution

  • In my case, dep looks great and fast enough, moreover, it's official dependency manager in go so I think it's a right choice.