Files
at-container-registry/Formula/docker-credential-atcr.rb
T

60 lines
1.9 KiB
Ruby

# typed: false
# frozen_string_literal: true
class DockerCredentialAtcr < Formula
desc "Docker credential helper for ATCR (ATProto Container Registry)"
homepage "https://atcr.io"
version "0.1.4"
license "MIT"
on_macos do
on_arm do
url "https://tangled.org/evan.jarrett.net/at-container-registry/tags/v#{version}/download/docker-credential-atcr_#{version}_Darwin_arm64.tar.gz"
sha256 "dc7d4f1a4b97f2ee47e36c146b72f294fbd0b38d3899f818509f4cb908acd52b"
end
on_intel do
url "https://tangled.org/evan.jarrett.net/at-container-registry/tags/v#{version}/download/docker-credential-atcr_#{version}_Darwin_x86_64.tar.gz"
sha256 "87550766eb3dec1878c63ad3c4f5c0a9916c5b5884902bbe316410661dccbb8d"
end
end
on_linux do
on_arm do
url "https://tangled.org/evan.jarrett.net/at-container-registry/tags/v#{version}/download/docker-credential-atcr_#{version}_Linux_arm64.tar.gz"
sha256 "831a9b388f6eed6e5619922c71d82b090b65297f0980cb2b462c82dd129b299b"
end
on_intel do
url "https://tangled.org/evan.jarrett.net/at-container-registry/tags/v#{version}/download/docker-credential-atcr_#{version}_Linux_x86_64.tar.gz"
sha256 "3037273abc84d1707d0c4746441337022d4dd23b4b94b5929439d6df42f407da"
end
end
def install
bin.install "docker-credential-atcr"
end
test do
assert_match version.to_s, shell_output("#{bin}/docker-credential-atcr version 2>&1")
end
def caveats
<<~EOS
To finish setup, run:
docker-credential-atcr configure-docker
This writes the credential helper entry to ~/.docker/config.json. Or
add manually:
{
"credHelpers": {
"atcr.io": "atcr"
}
}
Then push an image to trigger device authorization:
docker push atcr.io/<your-handle>/<image>:latest
Credentials live in ~/.atcr/device.json (0600).
EOS
end
end