Fix Docker build failure in Go application#34
Merged
JoshuaAFerguson merged 3 commits intoNov 16, 2025
Merged
Conversation
…Docker build The Docker build was failing because the code imports github.com/coreos/go-oidc/v3/oidc in internal/auth/oidc.go but this dependency was not declared in go.mod. Changes: - Add github.com/coreos/go-oidc/v3 v3.16.0 to go.mod - Move several direct dependencies from indirect to direct section - Add github.com/go-jose/go-jose/v4 as indirect dependency (required by go-oidc) - Update golang.org/x/oauth2 to v0.28.0 - Update go.sum with new dependency checksums This fixes the compilation error that was causing the Docker build to fail with exit code 1.
The cosign sign commands were incorrectly combining image tags with digests, creating invalid OCI image references like 'image:tag@sha256:digest'. This was causing the error: 'could not parse reference: ghcr.io/JoshuaAFerguson/streamspace-ui@sha256:...' Changes: - Replace 'xargs' loop that combined tags with digest - Use direct image reference with digest only: IMAGE_PREFIX-component@digest - This creates valid OCI references like 'ghcr.io/.../streamspace-ui@sha256:...' - Applied to all three image builds: controller, api, and ui The signing now uses the canonical image digest reference which is the recommended approach for cosign signing.
The Docker build was still failing because go.sum was missing package checksums for several dependencies, even though they were declared in go.mod. Changes: - Add missing package hashes (h1:...) for k8s.io packages at v0.31.0 - k8s.io/api v0.31.0 - k8s.io/apimachinery v0.31.0 - k8s.io/client-go v0.31.0 - k8s.io/metrics v0.31.0 - Add missing package hash for github.com/go-jose/go-jose/v4 v4.1.3 - Add missing package hash for golang.org/x/oauth2 v0.28.0 - Keep Go version at 1.23 to match Dockerfile These checksums are required by Go's module system to verify the integrity of downloaded dependencies during the Docker build process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.