Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jason Hall imjasonh

🏠
Working from home
View GitHub Profile
@imjasonh
imjasonh / main.go
Created Jun 28, 2022
Demonstrating go-containerregistry basic auth keychain
View main.go
package main
import (
"fmt"
"log"
"github.com/google/go-containerregistry/pkg/authn"
"github.com/google/go-containerregistry/pkg/crane"
"github.com/google/go-containerregistry/pkg/v1/google"
)
View fulcioroots.diff
diff ../cosign/cmd/cosign/cli/fulcio/fulcioroots/fulcioroots.go pkg/fulcioroots/fulcioroots.go
2c2
< // Copyright 2021 The Sigstore Authors.
---
> // Copyright 2022 The Sigstore Authors.
24d23
< "os"
27d25
< "github.com/sigstore/cosign/pkg/cosign/tuf"
28a27
@imjasonh
imjasonh / glob_test.go
Created May 23, 2022
Unit test for image ref glob matching, with support for **
View glob_test.go
package glob_test
import (
"fmt"
"regexp"
"strings"
"testing"
"github.com/google/go-containerregistry/pkg/name"
)
View Makefile
build:
GOOS=linux go build ./
View gist:45435117182543efd1427cab3dd533d3
$ git clone https://github.com/google/ko
$ cd ko
$ go build ./
$ go version -m ko
ko: go1.18
path github.com/google/ko
mod github.com/google/ko (devel)
dep cloud.google.com/go v0.99.0 h1:y/cM2iqGgGi5D5DQZl6D9STN/3dR/Vx5Mp8s752oJTY=
dep github.com/Azure/azure-sdk-for-go v55.8.0+incompatible h1:EuccMPzxu67cIE95/mrtwQivLv7ETmURi5IUgLNVug8=
dep github.com/Azure/go-autorest/autorest v0.11.19 h1:7/IqD2fEYVha1EPeaiytVKhzmPV223pfkRIQUGOK2IE=
@imjasonh
imjasonh / README.md
Last active May 11, 2022
Scrape GH dep graph to find dependents
View README.md

This scrapes GitHub's dep graph page to find dependents of a repo, and writes it to a file for processing.

This is useful because GitHub's API doesn't currently support querying dependents, and the page in the UI is not sorted.

pkg.go.dev also shows dependents per-Go-package, including non-GitHub repos, but it's not sorted in any useful way to discover "popular" dependents.

Lines in the output are [repo] [stars] [forks]

It's incomplete and could probably be improved, but it scratches my itch. Feel free to fork it and do what you want.

@imjasonh
imjasonh / .gitignore
Last active Apr 11, 2022
registry proxy for distroless.dev/* -> ghcr.io/distroless/*
View .gitignore
redir
*.tar
@imjasonh
imjasonh / apko-multiarch
Created Mar 7, 2022
output of successfully building a multiarch nginx with apko
View apko-multiarch
$ docker run -v $(pwd):/apko -v $HOME/.docker:/home/.docker/ --env HOME=/home --workdir=/apko --rm $(LDFLAGS="" ko publish ./ --local) publish examples/nginx.yaml imjasonh/apko-multi
2022/03/07 16:27:40 Using base docker.io/alpine:latest@sha256:21a3deaa0d32a8057914f36584b5288d2e5ecc984380bc0118285c70fa8c9300 for chainguard.dev/apko
2022/03/07 16:27:41 Using build config apko for chainguard.dev/apko
2022/03/07 16:27:41 Building chainguard.dev/apko for linux/amd64
2022/03/07 16:27:43 Loading ko.local/apko-dcb9ca1d2eeb2d9c373af1f03918cd68:2a117512acd4b4a624a553a5cf9931e38766119c7203eead759e1ee0a5808a1c
2022/03/07 16:27:45 Loaded ko.local/apko-dcb9ca1d2eeb2d9c373af1f03918cd68:2a117512acd4b4a624a553a5cf9931e38766119c7203eead759e1ee0a5808a1c
2022/03/07 16:27:45 Adding tag latest
2022/03/07 16:27:45 Added tag latest
2022/03/07 21:27:46 loading config file: examples/nginx.yaml
2022/03/07 21:27:46 building tags [imjasonh/apko-multi]