DEV Community

Discussion on: Multi-stage Dockerfile for Golang application

Collapse
 
dorianamouroux profile image
Dorian Amouroux

You should use the same version of Alpine linux on both stage to make sure you don't run into issues later

Collapse
 
plutov profile image
Alex Pliutau

To be honest, I am not sure what issues I can meet there, because it will be one image for the last FROM directive.

Collapse
 
dorianamouroux profile image
Dorian Amouroux

But the binary is compiled on golang:1.8.1 which is Jessie I believe. I think it would be safer to have FROM golang:1.8.1-alpine for the first stage and FROM alpine:3.5 for the second one. (golang:1.8.1-alpine is from alpine:3.5)

Thread Thread
 
sarbash profile image
Sergey Sarbash

A static build can save you.