Skip to content

Instantly share code, notes, and snippets.

@sallyom
sallyom / local-registry-10-yr-cert-with-SAN.sh
Last active August 15, 2022 17:43
set up a local registry at localhost:5000 (or gcp hostname if in gcp instance uncomment L5, comment L6) with SAN cert good for 10yrs
#!/bin/bash
set -euxo pipefail
trap "rm -rf create-registry-certs" EXIT
# Set up local registry with long-lived certs with SAN
# if in gcp instance
#HOSTNAME=$(curl "http://metadata.google.internal/computeMetadata/v1/instance/hostname" -H "Metadata-Flavor: Google")
HOSTNAME=localhost
sudo dnf -y install podman httpd httpd-tools make