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
this has the disadvantage of being a large image (because it's based on
golang:alpine and not alpine, plus the fact that building the project
creates various cache files, though these cache files are the things we
need in order to speed up compiling the project on the main go build
line. most of the compilation time is spent on the dependenent libraries
(i.e. discordgo, crypto, stdlib, etc).
there is not a functional method of compiling dependencies from a bare
go.mod and go.sum file[1], you must have a valid go project in the
directory for go build all to work, at which point the docker layer
cache has been invalidated by `COPY . /app`. the proposed
`go list -export $(go list -m)/...` does not compile all dependencies
either, showcased by checking the size of $GOCACHE before and after
running `go build all`
without doing funky stuff like bind-mounting a volume container into the
build container[2], inflating the image size for faster compiling seems
to be the best tradeoff, as the image will only stay local anyway
[1] golang/go#27719
[2] https://github.com/banzaicloud/docker-golang
0 commit comments