From b270f976c52c2f9900e6f51ea989ad9e406d10d4 Mon Sep 17 00:00:00 2001 From: Rui Lopes Date: Thu, 3 Sep 2026 07:33:03 +0000 Subject: [PATCH] create the oci-hosted repository --- README.md | 1 + provision/provision-nexus.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/README.md b/README.md index bcff405..b4a9c51 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ This will: * Create the `powershell-group`, `powershell-hosted` and `powershellgallery.com-proxy` repositories. * Create the `chocolatey-group`, `chocolatey-hosted` and `chocolatey.org-proxy` repositories. * Create the `docker-group`, `docker-hosted` and `docker-hub-proxy` repositories. + * Create the `oci-hosted` repository. * Configure the NuGet `nuget-hosted` repository to accept pushing with an API key. * Configure Nexus through Groovy scripts. * Schedule a task to remove the old snapshots from the `maven-snapshots` repository. diff --git a/provision/provision-nexus.sh b/provision/provision-nexus.sh index 8a2e3ff..59d62e4 100644 --- a/provision/provision-nexus.sh +++ b/provision/provision-nexus.sh @@ -512,6 +512,35 @@ http \ EOF +# create the oci-hosted oci repository. +# see https://help.sonatype.com/en/oci-repositories.html +http \ + --check-status \ + --auth "$api_auth" \ + POST \ + https://$nexus_domain/service/rest/v1/repositories/oci/hosted \ + <<'EOF' +{ + "name": "oci-hosted", + "online": true, + "storage": { + "blobStoreName": "default", + "strictContentTypeValidation": true, + "writePolicy": "allow_once", + "latestPolicy": true + }, + "component": { + "proprietaryComponents": true + }, + "oci": { + "v1Enabled": false, + "forceBasicAuth": true, + "pathEnabled": true + } +} +EOF + + # create the docker-hosted docker registry repository. # see https://help.sonatype.com/en/docker-registry.html http \