Closed Andrew-Morozko closed 3 weeks ago
Why not to just use goreleaser
? It copies already built binary to the image. Or did you receive this error by attempting to run goreleaser
during docker image build phase?
Note that we are not building any go files in the Docker build phase, we are merely copying the binary to a scratch image and setting up the entrypoint. https://goreleaser.com/customization/docker/
Also, we should probably build image that supports multiple platforms and archs.
Why not to just use
goreleaser
?
Ah! Didn't think about it 😅. Will do)
Ok, I've set up the workflow with Goreleacer.
Unfortunately, it's a bit ugly: we first must build and push each platform-specific version (I named them something like latest-amd64v1
) before combining them via manifest into a single tag like "{{ .Version }}" or "latest".
It's possible to do this without these extra versions, but I can't find a way to extract the hashes out of the "dockers" build step to use them instead of tags in "docker_manifests".
I make multiplatform builds only for linux/386, linux/amd64 and linux/arm64
I started working on a full dockerization of the project, but goreleaser was throwing some strange errors like
And I thought that since we already have the built artifacts - why not just reuse them? Here's a simple dockerfile that just downloads the latest release from github. Is this enough, or should it build the binary from scratch?