Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added dockerfile and multiarch build job in goreleaser workflow. fixe… #1868

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maehldom
Copy link

…s #1801

@andreynering andreynering added the area: releasing Changes related to the release process. label Oct 17, 2024
@andreynering andreynering linked an issue Oct 17, 2024 that may be closed by this pull request
file: ./Dockerfile
push: true
tags: |
go-task/task:latest

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this workflow is triggered on tag creation, it would be a good idea to tag the created image with the version tag that was created in git. That way we can have matching tags for the docker images and the git repo.

We can still leave in a latest tag, but I consider actual version tags to be a requirement to properly use this image


WORKDIR /app

RUN /app/install-task.sh -b /usr/local/bin

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main gripe with this is that is is, at least as far as I understand, quite impossible for docker to cache any layers to speed up builds.

@@ -0,0 +1,9 @@
FROM golang:1.23.2-alpine

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would technically only be the build stage. For the final "production" stage, there is no need to have golang as a base. We could do alpine or something smaller


docker:
runs-on: ubuntu-latest
needs: goreleaser

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason we need to wait for the goreleaser job? I don't see any hard dependency and we could save some time by executing these jobs in parallel

@mircea-pavel-anton
Copy link

goreleaser already does cross-compilation for multi-arch builds and supports creating docker images too. In my experience, it is also much faster at it. As far as I can tell, this does not implement multi-arch support.

@maehldom is there any reason for going with this approach instead of going with goreleaser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: releasing Changes related to the release process.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distribute as Docker Image
3 participants