Skip to content

Fix Docker build failure in Go application#34

Merged
JoshuaAFerguson merged 3 commits into
mainfrom
claude/fix-docker-build-error-01VHt4LgA588uuPST8Ui5zYQ
Nov 16, 2025
Merged

Fix Docker build failure in Go application#34
JoshuaAFerguson merged 3 commits into
mainfrom
claude/fix-docker-build-error-01VHt4LgA588uuPST8Ui5zYQ

Conversation

@JoshuaAFerguson

Copy link
Copy Markdown
Member

No description provided.

…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.
@JoshuaAFerguson JoshuaAFerguson merged commit 1f72ba1 into main Nov 16, 2025
8 of 23 checks passed
@JoshuaAFerguson JoshuaAFerguson deleted the claude/fix-docker-build-error-01VHt4LgA588uuPST8Ui5zYQ branch November 16, 2025 09:00
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.

2 participants