8 ms·
You don’t typically include the entire toolchain in a container with docker because of the size. You also want to construct things a bit carefully so you get pr
by prpl 7y ago
You don’t typically include the entire toolchain in a container with docker because of the size. You also want to construct things a bit carefully so you get proper build caching, but it’s doable.
Here is an example of this pattern with Go:
https://github.com/pusher/oauth2_proxy/blob/master/Dockerfile https://github.com/pusher/oauth2_proxy/blob/master/Dockerfil...
- Legogris 7y agoRight, but how does that relate to OP?
- xena 7y agoFROM xena/go:1.13.6 AS build ENV GOPROXY https://cache.greedo.xeserv.us COPY . /site WORKDIR /site RUN CGO_ENABLED=0 go test -v ./... RUN CGO_ENABLED=0 GOBIN=/root go install -v ./cmd/site FROM xena/alpine EXPOSE 5000 WORKDIR /site COPY --from=build /root/site . COPY ./static /site/static COPY ./templates /site/templates COPY ./blog /site/blog COPY ./talks /site/talks COPY ./gallery /site/gallery COPY ./css /site/css HEALTHCHECK CMD wget --spider http://127.0.0.1:5000/.within/health || exit 1 CMD ./site As far as I understand, this is a multi-stage build.
- _-___________-_ 7y agoYes, but it goes to the trouble of making a static, dependency-free executable in the first stage, and then builds the second stage from alpine anyway.