You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current images ship with the building environment it required to build the binaries.
With Docker multi stage builds the result of the build can be copied to a new clean image that does not have the build env with is not required anymore, e.g. :
FROM golang:1.7.3 as builder
WORKDIR /go/src/github.com/alexellis/href-counter/
RUN go get -d -v golang.org/x/net/html
COPY app.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /go/src/github.com/alexellis/href-counter/app .
CMD ["./app"]
With this images will be lighter.
Regards.
The text was updated successfully, but these errors were encountered:
The alpine-based php images are made for this exact reason; they are small and remove build dependencies in the layer that they are added to save space. No need to have a multi stage build for that.
Hi,
Current images ship with the building environment it required to build the binaries.
With Docker multi stage builds the result of the build can be copied to a new clean image that does not have the build env with is not required anymore, e.g. :
With this images will be lighter.
Regards.
The text was updated successfully, but these errors were encountered: