← Start of tutorial

WIUNIX ACADEMY

Private Docker registry with Nginx HTTPS and native authentication

Page 5 of 5. Review the earlier steps and prerequisites before continuing.

YOUR SYSTEM. YOUR STEPS.

Where are you working?

Choose your OS and version. The prerequisites, commands and troubleshooting follow your environment.

AlmaLinux 10.2 (standard channel)Reviewed against official documentation ·

USE YOUR OWN VALUES

Configure this tutorial

Set the example values for your environment; related explanations and copy panels update together. Never enter passwords, private keys or tokens. Values stay in this tab and are not sent to the server or share links. Check actual DNS, certificates and network policy before running commands.

Different IP addresses, domains or ports? Open the settings below, change the values and select “Apply to tutorial”, then copy the updated commands.

Set values for my environment8 editable values
19

LET’S BUILD

Understand deletion before a GC dry run

Deleting a tag or manifest is different from reclaiming blobs. The current service has API deletion disabled. Enabling deletion later requires an authorization/retention decision and version-matched API semantics; it is not needed for push/pull. Never delete storage files manually. Garbage collection marks referenced objects then sweeps unreferenced objects; concurrent uploads can lose layers.

The panel performs only a dry run while the service is fully stopped, with read-only data and the exact pinned image. Even dry-run output can disclose repository names, so keep it private. After a reviewed backup and isolated restore rehearsal, destructive GC needs a separate deliberate maintenance action; omit --delete-untagged unless you explicitly accept its tag/digest and multi-platform consequences. Alternatively readonly maintenance requires restart of every writer into readonly mode and observed write denial before GC; do not merely edit YAML while it is running.

bash

Registry VM

set -eu
sudo docker stop --time 90 'academy-registry'
sudo test "$(sudo docker inspect --format '{{.State.Running}}' 'academy-registry')" = false
sudo docker run --rm --network none --user '23153:23153' \
  --read-only --cap-drop ALL --security-opt no-new-privileges --log-driver none \
  --volume '/srv/academy-registry/data:/var/lib/registry:ro,z' \
  --volume '/srv/academy-registry/auth:/auth:ro,z' \
  --volume '/srv/academy-registry/config:/etc/distribution:ro,z' \
  --entrypoint /bin/registry 'docker.io/library/registry:3.1.2@sha256:ddf754342cfc8acc51a56d5d0ab6af06826461864460636d8bd5c546dab2a7b8' \
  garbage-collect --dry-run /etc/distribution/config.yml
sudo docker start 'academy-registry'
How do I know it worked?

Dry run lists mark/sweep candidates without deletion; the original registry starts again.

Recover without weakening authentication

If the first Nginx reload fails, move only the new site file to the protected recovery directory, validate Nginx again and reload its previous valid configuration. Keep the loopback registry private. If a registry update fails, stop writers and preserve the failed container/config and storage snapshot before using the previous reviewed image with compatible data. Never downgrade across a storage-format boundary without upstream guidance.

For credential rotation, edit a protected candidate bcrypt file, preserve the previous root-only copy, atomically replace it and restart this registry after uploads drain. Test both the old-password denial and new-password acceptance without recording either password. Rollback restores a known-good authenticated configuration; removing auth, publishing backend HTTP or disabling TLS trust is not a recovery method.

What was actually tested

Historical isolated Ubuntu24.04 checks used the Distribution3.1.2 binary as a nonroot process with Nginx1.24.0, fixture loopback listeners and private-CA OCI HTTP requests. They exercised authentication, Host rejection, trusted upload Location, chunked transfer, manifest/blob push and exact fresh pull, restart persistence,413 limits, readonly denial and stopped-writer GC dry-run. They did not execute Docker Engine port publishing or pass/GPG helper login.

The current OS expansion is documentation-reviewed, not a new runtime execution on every distribution. Operational acceptance still requires real managed Docker/helper login, independent push/pull, intended-network DNS/TLS, suitable large layers, renewal, host reboot, encrypted off-host backup and isolated restoration. Source/schema/browser checks and illustrative photography do not establish those results.

Move from pilot to controlled operations

Before connecting CI, assign ownership for disk/inode/certificate-expiry and failed-auth monitoring, credential rotation, encrypted recovery and digest-pinned deployment. Choose repository authorization and retention rules for your actual teams. Benchmark the intended layer sizes and concurrency; this tutorial makes no throughput, HA, SLA or universal security compliance claim.

GO TO THE SOURCE

Official references

Each environment states how it was reviewed. A documentation review does not claim a hands-on test of every version.

KEEP LEARNING

Your next step

Explore all tutorials ↗