Skip to content

GoReleaser config and multi-platform image builds#1052

Open
kgaughan wants to merge 1 commit into
goss-org:masterfrom
kgaughan:goreleaser
Open

GoReleaser config and multi-platform image builds#1052
kgaughan wants to merge 1 commit into
goss-org:masterfrom
kgaughan:goreleaser

Conversation

@kgaughan
Copy link
Copy Markdown

@kgaughan kgaughan commented Apr 12, 2026

Checklist
  • make test-all (UNIX) passes. CI will also test this
  • unit and/or integration tests are included (if applicable)
  • documentation is changed or added (if applicable)

Description of change

Using GoReleaser simplifies the build process substantially, as it handles almost all the logic that needed to be in the makefile and the pipelines themselves.

As my repo is a fork and I've specified ghcr.io/goss-org/goss as the image name, GoReleaser is (naturally) unable to push the final image, leading to the following expected behaviour:

ERROR: failed to push ghcr.io/goss-org/goss:latest: failed to authorize: failed to fetch anonymous token:
unexpected status from GET request to https://ghcr.io/token?scope=repository%3Agoss-org%2Fgoss%3Apull%2Cpush&service=ghcr.io: 403 Forbidden

However, the 'GITHUB_TOKEN' secret should allow this to work on the main repo. This does at least show that it's able get through the multiplatform image build without issue.

Owing to how GoReleaser works, I added something so that generating the .sha256 files for the {d,dc,k}goss scripts wouldn't cause GoReleaser to treat the repo as dirty. It also encourages building archives rather than attaching uncompressed binaries to releases.

Incidentally, this means that the goss images are now built with SBOMs. It's straightforward to extend the configuration to also build packages and generate SBOMs for the release artifacts too.

I believe this should mean the Travis CI pipelines can go away.

I'd also note that the pipeline described by docker-goss.yaml is broken owing to aquasecurity/trivy-action's 0.24.0 tag no longer exists (likely due to the issues with and attacks on Trivy over the past few months). This new pipeline can do everything as far as release builds go, so I think that could be trimmed down to just a simple build of the master image on pushes to the master branch.

Incidental changes:

  • Alpine base image bumped to 3.23.

Using GoReleaser simplifies the build process substantially, as it
handles almost all the logic that needed to be in the makefile and the
pipelines themselves.

The one things that's missing from all this is a PAT to allow GoReleaser
to push to ghcr.io. That means it fails here (which is expected):

```
ERROR: failed to push ghcr.io/goss-org/goss:latest: failed to authorize: failed to fetch anonymous token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Agoss-org%2Fgoss%3Apull%2Cpush&service=ghcr.io: 403 Forbidden
```

Adding a PAT called 'GITHUB_TOKEN' as a secret would allow this to work
on the main repo.

Owing to how GoReleaser works, I added something so that generating the
.sha256 files for the {d,dc,k}goss scripts wouldn't cause GoReleaser to
treat the repo as dirty. It also encourages building archives rather
than attaching uncompressed binaries to releases.

Incidentally, this means that the goss images are now built with SBOMs.
It's straightforward to extend the configuration to also build packages
and generate SBOMs for the release artifacts too.

I believe this should mean the Travis CI pipelines can go away.

I'd also note that the pipeline described by docker-goss.yaml is broken
owing to aquasecurity/trivy-action's 0.24.0 tag no longer exists (likely
due to the issues with and attacks on Trivy over the past few months).
This new pipeline can do everything as far as release builds go, so I
think that could be trimmed down to just a simple build of the master
image on pushes to the master branch.
@kgaughan kgaughan requested a review from aelsabbahy as a code owner April 12, 2026 12:10
@kgaughan kgaughan mentioned this pull request Apr 12, 2026
@kgaughan
Copy link
Copy Markdown
Author

kgaughan commented May 8, 2026

That Ubuntu integration test wasn't failing previously. I'm going to dig into it, but I'll have to wait until the weekend.

@kgaughan
Copy link
Copy Markdown
Author

kgaughan commented May 8, 2026

The issues look to be mostly down to changes in test services and new OS releases that bumped some version numbers. There are a few dummy services (http in, for example) that look to either not be starting to not accessible.

@kgaughan
Copy link
Copy Markdown
Author

I investigated this while on the train yesterday. The issue appear to be because dnstest.io, which the integration tests rely on, is now parked.

A sensible alternative would be to spin up something like dnsmasq internally and have it act as the resolver for the tests. dnsmasq can serve authoritative zones, and goss's dns test module supports the specification of a server to query, so specifying server: 127.0.0.1:8053 should work. GH Actions supports service containers, though if necessary it wouldn't be the end of the world to spin up dnsmasq in the background if necessary. I'll create an issue for this.

@kgaughan
Copy link
Copy Markdown
Author

My integration tests fixes work, and I've opened a pull request for them: #1061.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant