add workflow for docker build#86
Conversation
|
Seems good. Can you also add a notice about how to access these in the documentation and the changelog please? |
|
Done. I hope it is ok like this |
|
As noted in the chat: this seems to increase the CI runtime significantly. Would it make sense to not run it on every PR? |
|
It's primarily the emulated arm64 compilation taking this long: There's in theory the trick to use (C)Go's cross-compilation on the native architecture instead of "normal" compilation within QEMU, but I couldn't get it to work in GitHub actions with an Alpine base image the last time I tried for one of our projects (which was two years ago or so, so the situation might have changed). Maybe a simple compromise would be building amd64 everytime and arm64 only on master push and/or tags. Of course there's the risk of it breaking without anyone noticing in a PR, but that might be an acceptable and low enough risk, as we're talking Go here. Apart from that what might still make sense regardless is something like this in the FROM [...]
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . /go/src/matterbridge
[...]Also the .dockerignore could be expanded so you don't re-copy and thus re-build when only the docs or README changes, although you could also skip the entire workflow in this case. |
This sounds good. @krombel could you adjust your PR accordingly please? Or just drop the automated builds of the arm64 containers entirely (I know from another project that Alpine based images have problems with those right now due to an upstream issue). Thanks! |
|
i would like to have the arm build as well so I kept it in the final build but excluded them from PRs. |
|
LGTM & Thanks for the contribution 👍 |
|
Could it be that you need to enable the container registry in the repo settings, or make it public @poVoq? |
|
Looks like it was set to private. I changed that to public now. |
This builds a docker image.
Only push to ghcr.io if it was pushed to master or triggered by tag