cisco-ie / pipeline-gnmi

A Model-Driven Telemetry collector based on the open-source tool pipeline
Apache License 2.0
32 stars 6 forks source link

Multi-stage Dockerfile #54

Closed remingtonc closed 5 years ago

remingtonc commented 5 years ago

Should we use alpine or stretch as base for image?

nleiva commented 5 years ago

To build the binary, golang:1.12-stretch as you selected.

For the final image with this (Pipeline) binary I'd say we want alpine. You typically want to reduce the attack surface and use something like distroless, however in this case we need a shell and a package manager for troubleshooting purposes I think (might be off here though).

The new Dockerfile looks much better now. Something else we can add, that I haven't tested yet but looks promising, is ENV GOPROXY=proxy.golang.org -> Go Module Mirror

remingtonc commented 5 years ago

@nleiva It's most likely that alpine:latest is cached and it's 3.7. docker pull alpine