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

Sign image builds #1219

Open
mattmoor opened this issue Dec 24, 2021 · 1 comment
Open

Sign image builds #1219

mattmoor opened this issue Dec 24, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request lifecycle/frozen

Comments

@mattmoor
Copy link
Collaborator

The images we publish here:

# Use the ko binary to build the crane and gcrane builder images.
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/crane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/gcrane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
# Use the ko binary to build the crane and gcrane builder *debug* images.
export KO_CONFIG_PATH=./.ko/debug/
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/crane -t "debug"
ko publish --platform=all -B github.com/google/go-containerregistry/cmd/gcrane -t "debug"
# Tag-specific debug images are pushed to gcr.io/go-containerregistry/{g}crane/debug:...
KO_DOCKER_REPO=gcr.io/$PROJECT_ID/crane/debug ko publish --platform=all --bare github.com/google/go-containerregistry/cmd/crane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"
KO_DOCKER_REPO=gcr.io/$PROJECT_ID/gcrane/debug ko publish --platform=all --bare github.com/google/go-containerregistry/cmd/gcrane -t latest -t "$COMMIT_SHA" -t "$TAG_NAME"

... should all be signed with cosign, ideally using the "keyless" flow.

For GCB-based keyless signing we can copy what distroless does here: https://github.com/GoogleContainerTools/distroless/blob/3ecf55603e31c8c01b4da2da8dc34a41757b778c/cloudbuild.yaml#L81-L82

... essentially the GCB SA is used to impersonate keyless@go-containerregistry.iam.gserviceaccount.com for the identity challenge. Some IAM needs to be configured, and then things just work 😉


I believe @jonjohnsonjr has to do this given the requirement that we futz with the GCP stuff, but @dlorenc or I would be happy to help navigate this.

@developer-guy
Copy link
Contributor

also, we can use GoReleaser to do that 🤩
cross-ref: ko-build/ko#491

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lifecycle/frozen
Projects
None yet
Development

No branches or pull requests

3 participants