Skip to content

Instantly share code, notes, and snippets.

View onlyjob's full-sized avatar
💭
I may be slow to respond.

onlyjob

💭
I may be slow to respond.
View GitHub Profile
@mortensteenrasmussen
mortensteenrasmussen / cleanupManifestsWithoutTags.sh
Last active March 15, 2023 12:47
Clean up untagged manifests in private docker registry
#!/bin/bash
REGISTRY_DIR=YOUR_REGISTRY_DIR/data/docker/registry/v2/repositories
REGISTRY_URL=http://10.10.10.10:5000
#add --insecure to the curl command on line 17 if you use https with self-signed certificates
cd ${REGISTRY_DIR}
count=0
manifests_without_tags=$(comm -23 <(find . -type f -name "link" | grep "_manifests/revisions/sha256" | grep -v "\/signatures\/sha256\/" | awk -F/ '{print $(NF-1)}' | sort) <(for f in $(find . -type f -name "link" | grep "_manifests/tags/.*/current/link"); do cat ${f} | sed 's/^sha256://g'; echo; done | sort))
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy