### Get the registry root GET https://registry-1.docker.io/
### Get the registry root GET https://registry-1.docker.io
### Get the registry root GET http://registry-1.docker.io
### Get the /v2 endpoint
### Get the registry root GET https://registry-1.docker.io/
### Get the registry root GET https://registry-1.docker.io
### Get the registry root GET http://registry-1.docker.io
### Get the /v2 endpoint
| # As per the instructions at https://github.com/Azure/acr/blob/main/docs/AAD-OAuth.md | |
| # Prep: Set env variables | |
| registry="<USE_YOUR_REGISTRY_HERE>" | |
| tenant="<USE_YOUR_TENANT_HERE>" | |
| subscription="<USE_YOUR_SUBSCRIPTION_HERE>" | |
| scope="registry:catalog:*" | |
| # Step 1: Get AAD access token | |
| aad_access_token=`az account get-access-token --subscription $subscription --query "accessToken" --output tsv` | |
| echo $aad_access_token | |
| # Step 2: Get a refresh token for ACR |
| # Generate fake signing key and request | |
| openssl req -utf8 -nameopt multiline,utf8 -config real-cert-data.conf -new -sha256 -newkey rsa:4096 -nodes -keyout real-key.pem -days 730 -out real-req.pem | |
| # Check the fake signing key and request | |
| openssl req -text -nameopt lname,sep_multiline,utf8 -in real-req.pem -noout | |
| # or | |
| openssl req -text -nameopt lname,utf8 -in real-req.pem -noout | grep Subject: | |
| # Self-sign the fake certificate request | |
| openssl x509 -req -nameopt lname,utf8 -days 730 -in real-req.pem -signkey real-key.pem -out real-cert.crt |
| { | |
| "modulesContent": { | |
| "$edgeAgent": { | |
| "properties.desired": { | |
| "modules": { | |
| "registry": { | |
| "settings": { | |
| "image": "registry:latest", | |
| "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5000/tcp\":[{\"HostPort\":\"5000\"}]}}}" | |
| }, |
| events { } | |
| http { | |
| proxy_buffers 32 160k; | |
| proxy_buffer_size 160k; | |
| proxy_read_timeout 3600; | |
| error_log /dev/stdout info; | |
| access_log /dev/stdout; |
| { | |
| "modulesContent": { | |
| "$edgeAgent": { | |
| "properties.desired": { | |
| "modules": { | |
| "connectedRegistry": { | |
| "settings": { | |
| "image": "10.16.7.4/acr/connected-registry:0.2.0", | |
| "createOptions": "{\"HostConfig\":{\"Binds\":[\"/home/azureuser/connected-registry:/var/acr/data\",\"/usr/local/share/ca-certificates:/usr/local/share/ca-certificates\",\"/etc/ssl/certs:/etc/ssl/certs\"]}}" | |
| }, |
| { | |
| "modulesContent": { | |
| "$edgeAgent": { | |
| "properties.desired": { | |
| "modules": { | |
| "connectedRegistry": { | |
| "settings": { | |
| "image": "mcr.microsoft.com/acr/connected-registry:0.2.0", | |
| "createOptions": "{\"HostConfig\":{\"Binds\":[\"/home/azureuser/connected-registry:/var/acr/data\"],\"PortBindings\":{\"8080/tcp\":[{\"HostPort\":\"8080\"}]}}}" | |
| }, |
| { | |
| "modulesContent": { | |
| "$edgeAgent": { | |
| "properties.desired": { | |
| "modules": { | |
| "registry": { | |
| "settings": { | |
| "image": "registry:latest", | |
| "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5000/tcp\":[{\"HostPort\":\"5000\"}]}}}" | |
| }, |
| #!/bin/bash | |
| # based on https://github.com/mew2057/CAST/blob/6c7f7d514b7af3c512635ec145aa829c535467dc/csm_big_data/config-scripts/logstashFixupScript.sh | |
| # see: https://github.com/elastic/logstash/issues/10755 | |
| apt-get update | |
| apt-get install -f zip unzip | |
| STARTDIR=$(pwd) | |
| JARDIR="/usr/share/logstash/logstash-core/lib/jars" |