DockerSelf-Hosting

Cosign with Docker: Sign Your Own Images and Verify Them Before You Run Them (Linux, Windows, Mac)

Before you start

  • 19 min read

Boxes marked Run in terminal are what you type; plain text explains why. Check what you need first

What you get in one minute#

Cosign is a free command-line tool from the Sigstore project. It signs the digest (the fingerprint) of a container image and checks that signature later, so your server runs only images that you, or your pipeline, signed.

Cosign official logo

Logo: the official Cosign project (source file in the Sigstore community repository, Apache-2.0 artwork licence, trademarks reserved)

Pulling over HTTPS proves you reached the right registry, not who built the image. A signature does. Cosign does not scan for security holes (Trivy) or update anything (Diun).

WhatValue (official sources, read 3 December 2026)
Current versionCosign v3.1.6, released 25 November 2026 (previous: v3.1.5, 24 November)
LicenceApache-2.0
InstallOne binary per system. Homebrew also has 3.1.6
Binary sizeAbout 140 MB on disk (Linux amd64, GitHub API)
Time neededAbout 30 minutes (our estimate)
PortsNone. It is a command, not a server
Official docsdocs.sigstore.dev

At a glance:

  • What you sign: a digest such as registry.example.com/homelab/myapp@sha256:..., never a tag.
  • Two ways: a key pair you keep (our path), or "keyless" with your e-mail identity (public).
  • Where signatures go: into your own registry (Docker Registry or Harbor guide), next to the image.
  • Surprise: in v3.1.6 even key-pair signing writes to a public log unless you switch that off (Step 4).
  • What we tested: key-pair signing, verifying and attesting on Windows against a local registry. Linux, Mac and keyless were not run.

How it fits together#

You sign the digest on the build machine with your private key, the signature is stored in the registry next to the image, and the server that runs the image verifies it with the public key and stops if the check fails.

Cosign flow: your image and the private key cosign.key go into step 1, cosign sign, which pushes the signature to your registry and optionally logs the event in the public Rekor log; the server runs step 2, cosign verify, with the public key, and only on OK pulls and runs the digest, otherwise it stops

Drawn for this guide from the official docs and our test run. The dashed arrow to Rekor is the part many people do not expect.

  • Digest: the fingerprint of the exact image. A tag can be moved to other content, a digest cannot.
  • Key pair: cosign.key signs and stays secret. cosign.pub verifies and can be shared.
  • Rekor: a public, append-only log of signing events. Anyone can read it. Entries cannot be removed.

Before you start#

Note: every key, password, domain and e-mail address on this page is a dummy example (change-me, registry.example.com, [email protected]). Replace them with your own and never publish real ones.

SystemWhat to have
LinuxDocker Engine, curl, a registry you can push to
WindowsWindows 10 or later, PowerShell, Docker Desktop (WSL 2)
MacDocker Desktop, Terminal, optionally Homebrew
Run in terminalbash
docker --version

Checklist:

  • [ ] A registry that accepts pushes over HTTPS (our Docker Registry guide with Traefik or Caddy, or Harbor)
  • [ ] An image you built, tagged for that registry
  • [ ] A password manager for the key password
  • [ ] A folder for keys outside every Git checkout (we use ~/docker_volumes/cosign/keys)

Tested on 2026-12-03: Windows = Cosign v3.1.6, Docker 29.9.2, a throwaway local registry:3.1.2, a throwaway key, dummy password change-me. Linux = not run. Mac = not run. Keyless = not run (it needs a browser sign-in and would publish an identity). The rest comes from the official docs and the source at tag v3.1.6.

Tip: Practise on a throwaway registry and key first.

Step 1: Install Cosign v3.1.6#

We pin the version and compare the download with the checksum file of the same release. That catches a damaged download, not a tampered release. The official docs describe a stronger check through the Sigstore TUF root (see Sources).

Linux#

Run in terminalbash
VERSION=v3.1.6
mkdir -p ~/docker_volumes/cosign/{keys,config,logs,backups}
cd ~/docker_volumes/cosign
curl -fLO "https://github.com/sigstore/cosign/releases/download/${VERSION}/cosign-linux-amd64"
curl -fLO "https://github.com/sigstore/cosign/releases/download/${VERSION}/cosign_checksums.txt"
grep ' cosign-linux-amd64$' cosign_checksums.txt | sha256sum -c -
sudo install -m 0755 cosign-linux-amd64 /usr/local/bin/cosign
cosign version

On ARM use cosign-linux-arm64 in all three places.

Windows (PowerShell)#

Codepowershell
$v = "v3.1.6"
$base = "$HOME\docker_volumes\cosign"
foreach ($d in "keys","config","logs","backups") { New-Item -ItemType Directory -Force "$base\$d" | Out-Null }
New-Item -ItemType Directory -Force "$HOME\bin" | Out-Null
Set-Location $base
Invoke-WebRequest "https://github.com/sigstore/cosign/releases/download/$v/cosign-windows-amd64.exe" -OutFile "$HOME\bin\cosign.exe"
Invoke-WebRequest "https://github.com/sigstore/cosign/releases/download/$v/cosign_checksums.txt" -OutFile cosign_checksums.txt
$want = ((Select-String -Path cosign_checksums.txt -Pattern 'cosign-windows-amd64\.exe$').Line -split '\s+')[0]
$have = (Get-FileHash "$HOME\bin\cosign.exe" -Algorithm SHA256).Hash.ToLower()
if ($want -eq $have) { "checksum OK" } else { "checksum DIFFERENT - delete the file" }
$env:Path += ";$HOME\bin"
cosign version

The Path line works for this window only. Add %USERPROFILE%\bin to your user Path to keep it.

Mac (Terminal)#

Run in terminalbash
brew install cosign
cosign version

Homebrew's formula showed 3.1.6 on 3 December 2026. Without Homebrew, use cosign-darwin-arm64 (Apple Silicon) or cosign-darwin-amd64 (Intel) with the Linux commands and shasum -a 256 -c.

Check it worked. Real output from our Windows run (shortened):

File contenttext
GitVersion:    v3.1.6
GitCommit:     252f10a80ba871152a12e5ee324ad1e02c85d079
Platform:      windows/amd64

Tip: Never write latest in a script or CI file. Some Cosign docs show @latest, which is how a pipeline changes behaviour overnight.

Step 2: Make a key pair outside Git#

Cosign asks for a password twice. Use a long one from your password manager (change-me is a dummy for tests).

Linux#

Run in terminalbash
cd ~/docker_volumes/cosign/keys
chmod 700 .
cosign generate-key-pair
chmod 600 cosign.key

Windows (PowerShell)#

Codepowershell
Set-Location "$HOME\docker_volumes\cosign\keys"
cosign generate-key-pair
icacls cosign.key /inheritance:r /grant:r "${env:USERNAME}:R"

We did not test the icacls line. It drops inherited permissions and leaves read access to your own account.

Mac (Terminal)#

Same commands as Linux.

Check it worked. Real output:

Codetext
Private key written to cosign.key
Public key written to cosign.pub

cosign.key is the encrypted private key. cosign.pub goes to every machine that verifies. Cosign can read the password from COSIGN_PASSWORD, which is handy in scripts and risky in shell history.

Add these lines to the .gitignore of every repository near the key:

Run in terminaltext
cosign.key
*.key
.env

An ignore rule does not undo an earlier commit. If a private key was ever in Git, even a private repository, make a new pair and stop trusting the old public key.

Tip: Back up cosign.key and keep its password somewhere else. Without both you can never sign again.

Step 3: Push the image and note its digest#

Take the digest from the push output, because that is what the registry stores.

Linux#

Run in terminalbash
docker login registry.example.com
docker tag myapp:1.0 registry.example.com/homelab/myapp:1.0
docker push registry.example.com/homelab/myapp:1.0

Windows (PowerShell)#

Run in terminalpowershell
docker login registry.example.com
docker tag myapp:1.0 registry.example.com/homelab/myapp:1.0
docker push registry.example.com/homelab/myapp:1.0

Mac (Terminal)#

Same commands as Linux.

The last push line holds the digest. Example output with a dummy digest (yours will differ):

File contenttext
1.0: digest: sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef size: 1023

Put it into a variable. Replace the placeholder <digest>:

File contentbash
IMAGE="registry.example.com/homelab/myapp@sha256:<digest>"

On Windows write $IMAGE = "registry.example.com/homelab/myapp@sha256:<digest>".

Check it worked. This asks the registry, not your local Docker, and must print the same digest:

Run in terminalbash
docker buildx imagetools inspect registry.example.com/homelab/myapp:1.0 --format '{{.Manifest.Digest}}'

Tip: Do not copy the digest from docker image inspect (RepoDigests). In our test on Docker 29.9.2 it showed another digest than the registry held, and signing it failed with a 404.

Step 4: Sign the digest#

Read this before you run anything. In v3.1.6 the default cosign sign contacts Sigstore's public services, even with your own key. We saw it: Cosign showed a notice and stopped when we said no. The notice (from the v3.1.6 source) says personal data "will be stored in public transparency logs and cannot be removed later". By the docs the logged object holds the artifact hash, the public key and the signature. A key pair has no certificate with your e-mail, so we expect none in the entry, but we did not publish one to look.

A: default (public log)B: no public log (our homelab pick)
Signcosign sign --key ...add --signing-config <file>
Rekor entryYes, after you accept a noticeNo
Verifycosign verify --key cosign.pubadd --insecure-ignore-tlog=true
Good forPublic images, an audit trailPrivate homelab images
We ran itNoYes, on registry:3.1.2

A private registry does not make Rekor private. Route B costs you only the public audit trail. The signing config is a tiny file that lists no log, the method named in Cosign's own error message (issue 5043).

Linux#

Run in terminalbash
cd ~/docker_volumes/cosign
cosign signing-config create \
  --no-default-fulcio --no-default-oidc --no-default-rekor --no-default-tsa \
  --out config/no-log.signingconfig.json
cosign sign --yes --key keys/cosign.key --signing-config config/no-log.signingconfig.json "$IMAGE"

Windows (PowerShell)#

Codepowershell
Set-Location "$HOME\docker_volumes\cosign"
cosign signing-config create `
  --no-default-fulcio --no-default-oidc --no-default-rekor --no-default-tsa `
  --out config\no-log.signingconfig.json
cosign sign --yes --key keys\cosign.key --signing-config config\no-log.signingconfig.json $IMAGE

Mac (Terminal)#

Same commands as Linux.

Cosign asks for the key password. Check it worked. Real output (our registry was a local test one):

Codetext
Signing artifact...
Pushing signature to: localhost:5055/demo/hello

The config file it wrote is just {"mediaType":"application/vnd.dev.sigstore.signingconfig.v0.2+json","rekorTlogConfig":{},"tsaConfig":{}}. For route A leave out --signing-config and answer y to the notice. We did not run route A.

Tip: --yes means "do not ask". Use it only in scripts, after one manual run where you read the notice.

Step 5: Verify the signature#

Linux#

Run in terminalbash
cosign verify --key ~/docker_volumes/cosign/keys/cosign.pub --insecure-ignore-tlog=true "$IMAGE"
cosign tree "$IMAGE"

Windows (PowerShell)#

Run in terminalpowershell
cosign verify --key "$HOME\docker_volumes\cosign\keys\cosign.pub" --insecure-ignore-tlog=true $IMAGE
cosign tree $IMAGE

Mac (Terminal)#

Same commands as Linux.

Check it worked. Output from our test run, exit code 0 (digests shortened and replaced by a dummy):

File contenttext
WARNING: Skipping tlog verification is an insecure practice that lacks transparency and auditability verification for the signature.

Verification for localhost:5055/demo/hello@sha256:01234567... --

[{"critical":{"identity":{"docker-reference":"localhost:5055/demo/hello@sha256:01234567..."},"image":{"docker-manifest-digest":"sha256:01234567..."},"type":"https://sigstore.dev/cosign/sign/v1"},"optional":{}}]
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - Existence of the claims in the transparency log was verified offline
  - The signatures were verified against the specified public key

The log line is printed although we skipped the log; the warning is the one to believe. With route B the flag is honest, because there is no log to check. Never add it just to make a failing keyless check pass.

Step 6: Make your server refuse unsigned images#

Installing Cosign does not make Docker check anything. You need a gate: verify, then pull. Pin the same digest in your Compose file (image: registry.example.com/homelab/myapp@sha256:<digest>).

Linux#

Save as ~/docker_volumes/cosign/deploy-check.sh, run chmod 700 on it:

File contentbash
#!/usr/bin/env bash
set -euo pipefail
IMAGE="registry.example.com/homelab/myapp@sha256:<digest>"   # dummy: replace
PUB="$HOME/docker_volumes/cosign/keys/cosign.pub"
cosign verify --key "$PUB" --insecure-ignore-tlog=true "$IMAGE" > /dev/null
docker pull "$IMAGE"
echo "Verified and pulled: $IMAGE"

Windows (PowerShell)#

Save as $HOME\docker_volumes\cosign\deploy-check.ps1:

Codepowershell
$IMAGE = "registry.example.com/homelab/myapp@sha256:<digest>"   # dummy: replace
$PUB = "$HOME\docker_volumes\cosign\keys\cosign.pub"
cosign verify --key $PUB --insecure-ignore-tlog=true $IMAGE | Out-Null
if ($LASTEXITCODE -ne 0) { throw "NOT signed with our key - not deploying" }
docker pull $IMAGE
"Verified and pulled: $IMAGE"

Mac (Terminal)#

Same script as Linux.

Check it worked. Run it against an image you did not sign. It must stop at cosign verify. Our unsigned test image gave Error: no signatures found (we did not record its exit code). The docs list exit codes 10 to 13 and say they may change, so we treat every non-zero code as "stop".

This gate guards only the path that uses it: a hand-typed docker pull skips it. On Kubernetes, the Sigstore policy-controller or Kyverno can enforce signatures; we did not test them.

Tip: Keep the public key on the verifying machine, not beside the image in the registry. Whoever can change the image can change a key stored next to it.

Step 7: Keyless signing and what it makes public#

Keyless means no long-lived key. Cosign makes a temporary key, you sign in through an OpenID Connect provider (the docs name Google, GitHub and Microsoft), Sigstore's certificate authority Fulcio issues a short-lived certificate for your identity, and the event goes into Rekor. The key is then thrown away.

The cost is publicity. The v3.1.6 notice says the data is "stored in public transparency logs and cannot be removed later", and the README says this includes the e-mail address of the account you sign in with. Anyone can see your identity, the image digest and the signature. The image layers are not uploaded to Rekor. Keyless suits open-source images you publish under a public name. It is a poor fit for a private homelab.

Linux#

Run in terminalbash
cosign sign "$IMAGE"
cosign verify \
  --certificate-identity '[email protected]' \
  --certificate-oidc-issuer 'https://accounts.google.com' \
  "$IMAGE"

Windows (PowerShell)#

Run in terminalpowershell
cosign sign $IMAGE
cosign verify `
  --certificate-identity '[email protected]' `
  --certificate-oidc-issuer 'https://accounts.google.com' `
  $IMAGE

Mac (Terminal)#

Same commands as Linux.

The e-mail and issuer are dummies: use the identity from your real sign-in. A valid certificate proves only that some identity signed, so you must name the one you expect. Without both flags Cosign stops with --certificate-identity or --certificate-identity-regexp is required for verification in keyless mode.

Check it worked. We did not run keyless signing, so we show no output.

Sign in CI (Woodpecker, Forgejo, GitHub)#

Sign only in a protected job, for example on a tag push. A job that runs other people's code (pull requests) must never see the signing secret.

Woodpecker (our Woodpecker guide). Add four repository secrets: cosign_private_key (the full text of cosign.key), cosign_password, registry_user, registry_password. The $$ is how Woodpecker writes a shell variable. The hash is the one in the v3.1.6 cosign_checksums.txt.

File contentyaml
when:
  - event: tag

steps:
  - name: sign
    image: alpine:3.24
    environment:
      COSIGN_PRIVATE_KEY:
        from_secret: cosign_private_key
      COSIGN_PASSWORD:
        from_secret: cosign_password
      REGISTRY_USER:
        from_secret: registry_user
      REGISTRY_PASSWORD:
        from_secret: registry_password
    commands:
      - apk add --no-cache curl
      - curl -fsSL -o /usr/local/bin/cosign https://github.com/sigstore/cosign/releases/download/v3.1.6/cosign-linux-amd64
      - echo "318a99ade4156a0c4113aa983b46c0a0830fa7896a096c63121ee47b610a94c6  /usr/local/bin/cosign" | sha256sum -c -
      - chmod 0755 /usr/local/bin/cosign
      - echo "$$REGISTRY_PASSWORD" | cosign login registry.example.com -u "$$REGISTRY_USER" --password-stdin
      - cosign signing-config create --no-default-fulcio --no-default-oidc --no-default-rekor --no-default-tsa --out no-log.json
      - cosign sign --yes --key env://COSIGN_PRIVATE_KEY --signing-config no-log.json "registry.example.com/homelab/myapp@sha256:<digest>"

An earlier step must build and push the image and give you its digest. We tested env:// keys and no-log signing on Windows, not this Woodpecker file.

Forgejo Actions (guide): the same commands in a run: step, with the variables filled from repository secrets such as ${{ secrets.COSIGN_PRIVATE_KEY }}. We found no documentation that public Sigstore accepts a self-hosted Forgejo as an identity provider, so use a key.

GitHub Actions: keyless is the normal route, because GitHub is an accepted provider. We did not run this:

File contentyaml
permissions:
  contents: read
  packages: write
  id-token: write
steps:
  - uses: sigstore/[email protected]
    with:
      cosign-release: "v3.1.6"
  - run: cosign sign --yes "ghcr.io/example/myapp@${DIGEST}"

Verify with the workflow identity and the issuer https://token.actions.githubusercontent.com.

Tip: A CI secret holding cosign.key is only as safe as the runner. Keep the password in its own secret and limit both to tag jobs.

Optional: attach a signed SBOM#

An attestation is a signed statement about the image, for example its ingredient list (SBOM). cosign attest signs the file; it does not create it. Make the SBOM with Syft (our guide). Types include spdxjson and cyclonedx.

Run in terminalbash
syft "$IMAGE" -o spdx-json=sbom.spdx.json
cosign attest --yes --key keys/cosign.key --signing-config config/no-log.signingconfig.json \
  --type spdxjson --predicate sbom.spdx.json "$IMAGE"
cosign verify-attestation --key keys/cosign.pub --insecure-ignore-tlog=true --type spdxjson "$IMAGE"

We ran this with a tiny custom predicate, not a real SBOM; attesting and verifying worked. It proves who signed the statement, not that the list is complete.

Where the signatures live (Registry and Harbor)#

Cosign v3 stores signatures as Sigstore bundles linked to the image as OCI referrers. Our Docker Registry guide uses registry:3.1.2, which in our test answered 404 to the referrers request. Cosign then used the fallback of the OCI rules: a tag named sha256-<digest> beside your tag. Our tag list showed exactly 1.0 and sha256-01234567.... Distribution's pull request for the referrers API (number 4828) was still open on 3 December 2026.

  • Old tutorials say .sig tags. A v3 signature does not use them.
  • Do not delete the extra tag. A cleanup script that removes odd tags removes your signature.
  • Same place on both sides. COSIGN_REPOSITORY points to another signature repository: set it for signer and verifier, or neither.

Harbor keeps a signature as an accessory of the image, replicates it with the image, and can block pulls of unsigned images per project. Its docs say cosign clean does not work against Harbor. We did not test Harbor. Users of Harbor 2.14 with Cosign v3 saw "unsigned" although cosign verify worked (issues 22592 and 22643, closed after pull request 22628). Test one signed and one unsigned pull on your version.

Copying. Copy the signature with the image and verify at the destination. cosign copy is deprecated in v3.1.6; its message points to oras copy -r or to cosign save and cosign load. A user copying between two repositories reported a failing check (issue 4564, open). See our Skopeo guide.

Security and testing#

ControlHow
Private keyOutside Git, mode 600, password in a manager, encrypted copy off the machine
Public keyOn every verifying machine, handed over through a channel you trust
PasswordPrefer the prompt. COSIGN_PASSWORD can land in shell history
Public logChoose route A or B in Step 4 on purpose
Key lost or leakedNew pair, re-sign what you run, drop the old public key everywhere

Cosign has no web page, so there is no HTTPS to set up for it, but your registry needs it. The --allow-insecure-registry flags are for tests only, as the help says.

Run in terminalbash
cosign version
cosign verify --key ~/docker_volumes/cosign/keys/cosign.pub --insecure-ignore-tlog=true "$IMAGE"
cosign tree "$IMAGE"

Common mistakes#

MistakeWhy it happensDo this instead
Signing fails with HEAD ... unexpected status code 404 Not FoundThe digest came from docker image inspect and is not what the registry stores (our test, Docker 29.9.2)Use the digest from the docker push line or docker buildx imagetools inspect
Signing a tag (...:1.0)It works, Cosign only warnsSign @sha256:<digest>. The warning says tag use "will be removed in a future release"
no signatures foundNo signature in that repository: copied without it, signed elsewhere, or never signed (issue 4973: the official v3.1.1 Cosign image was reported as unsigned)Run cosign tree, check the repository and COSIGN_REPOSITORY. Update an old Cosign
not enough verified log entries from transparency log: 0 < 1You signed without a public log (route B) and verified like route AAdd --insecure-ignore-tlog=true on purpose, or sign with the log
--certificate-identity or --certificate-identity-regexp is required (issue 2632)Keyless verification must know who may signPass identity and issuer. Never use .* to silence it
--tlog-upload=false is not supported with --signing-config or --use-signing-config (issue 5043)A v2 tutorial's flags meet v3 signing configsUse the config from Step 4. The legacy format needs --use-signing-config=false, which uses the public log
Harbor blocks a pull: unknown: The image is not signed by cosign. (issue 22643)Harbor 2.14 did not recognise the v3 formatUse a Harbor with the fix and test a signed and an unsigned pull
AI assistants: "key signing is private and needs no internet"True for v2 with --tlog-upload=false. v3.1.6 asks to publish by default, also with --keyRead the notice, choose route A or B
AI assistants: .sig tags, cosign copy, cosign attach signature, --new-bundle-formatOld tutorials. copy is deprecated, attach is not in the v3.1.6 command list, the bundle format is the defaultUse this guide's commands and cosign --help for your version

Tip: After any change (new Cosign, new registry, new CI job) sign a throwaway image and verify it before touching a real one.

Troubleshooting#

ProblemSolution
Command not foundOpen a new terminal, check PATH, run cosign version
Password prompt in CISet COSIGN_PASSWORD from a secret in that step
Registry login errorsCheck docker login, cosign login and HTTPS on the registry
Need more detailAdd -d (verbose). cosign sign --help lists flags; deprecated ones are hidden but may work

Error: decrypt: encrypted: decryption failed#

Real output of cosign public-key --key cosign.key with a wrong password. There is no reset: use the right password or restore the key.

Error: no matching attestations: failed to verify signature: could not verify envelope: accepted signatures do not match threshold, Found: 0, Expected 1#

Real output when we verified with a different public key than the one used to sign. It says "attestations" even for a plain signature. Use the right cosign.pub.

Known bugs (December 2026)#

Issue 4831 (open): the rules tying --signing-config to the bundle format are confusing. Issue 4564 (open): checks fail after copying between repositories on one registry. We found nothing that stops a normal key-pair setup on a plain registry.

Updates and backups#

Update Cosign: read the release notes, then repeat Step 1 with the new version and checksum. v3.1.3 fixed a verification bypass in old-format bundles (advisory GHSA-fx35-mq7g-6g98), so do not stay on early v3.1 releases.

Back up keys, config and your scripts. Signatures live in the registry, so back that up as its guide says.

Linux and Mac#

Save as ~/docker_volumes/cosign/backup.sh:

File contentbash
#!/usr/bin/env bash
set -euo pipefail
base="$HOME/docker_volumes/cosign"
out="$base/backups/cosign-$(date +%F).tar.gz"
tar -czf "$out" -C "$base" keys config
chmod 600 "$out"

Run chmod 700 on it and add 0 3 * * * /home/<your-user>/docker_volumes/cosign/backup.sh with crontab -e (Mac: /Users/<your-user>/...). Copy the archive to another machine too.

Windows (PowerShell)#

Save as $HOME\docker_volumes\cosign\backup.ps1:

Codepowershell
$base = "$HOME\docker_volumes\cosign"
$out = "$base\backups\cosign-$(Get-Date -Format yyyy-MM-dd).tar.gz"
tar.exe -czf $out -C $base keys config

In Task Scheduler run powershell.exe -NoProfile -File <full-path-to-the-script> daily at 03:00.

Restore test#

Unpack into an empty folder and rebuild the public key from the restored private key:

Run in terminalbash
mkdir -p /tmp/cosign-restore && tar -xzf cosign-<date>.tar.gz -C /tmp/cosign-restore
cosign public-key --key /tmp/cosign-restore/keys/cosign.key > /tmp/cosign-restore/restored.pub
diff /tmp/cosign-restore/restored.pub /tmp/cosign-restore/keys/cosign.pub && echo "restore OK"

Delete the folder afterwards. We tested the public-key comparison on Windows only.

Performance and resources#

The docs give no figures and we measured none. Cosign is a short-lived command with no background service, so docker stats has nothing to show. The public route depends on Sigstore's services, and the README advises a retry when signing fails with HTTP errors. Route B needs only your own registry.

FAQ#

Is a signature the same as a safe image? No. It shows who published the digest, not that the contents are free of holes. Scan with Trivy too.

Key pair or keyless for a homelab? A key pair, with route B for private images. Keyless puts an identity in a public log that you cannot edit later.

Does my registry need a special feature? Not for signing. registry:3.1.2 has no referrers API and still worked through the fallback tag.

What if I lose the key? You cannot sign with it again. Make a new pair, sign again, and replace the public key on every verifier.

Sources#

Checked against the official docs on 2026-12-03. Key-pair signing, verifying and attesting were run by DIY Lab Hub on Windows on 2026-12-03 against a throwaway local registry; Linux, Mac, keyless signing, Harbor and the CI files were not run.

Try one of these