mirror of
https://github.com/openshift/image-registry.git
synced 2026-02-05 09:45:55 +01:00
Add a test script to assist in running a local registry
Was accidentally dropped when moved over from image-registry
This commit is contained in:
26
hack/test-local-registry.sh
Executable file
26
hack/test-local-registry.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
|
||||
#
|
||||
# This script launches the image registry pointing to the OpenShift master defined in
|
||||
# the KUBECONFIG environment variable (and uses the current credentials as the client
|
||||
# credentials). You may need to start your master with the internalRegistryHostname
|
||||
# configuration variable set for some image stream calls to function properly.
|
||||
#
|
||||
|
||||
source "$(dirname "${BASH_SOURCE}")/lib/init.sh"
|
||||
|
||||
os::build::setup_env
|
||||
|
||||
os::util::ensure::built_binary_exists 'dockerregistry'
|
||||
|
||||
url="${REGISTRY_OPENSHIFT_SERVER_ADDR:-localhost:5000}"
|
||||
# find the first builder service account token
|
||||
token="$(oc get $(oc get secrets -o name | grep builder-token | head -n 1) --template '{{ .data.token }}' | os::util::base64decode)"
|
||||
echo
|
||||
echo "Login with:"
|
||||
echo " docker login -p \"${token}\" -u user ${url}"
|
||||
echo
|
||||
|
||||
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY="${REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY:-/tmp/registry}" \
|
||||
REGISTRY_OPENSHIFT_SERVER_ADDR="${url}" \
|
||||
dockerregistry images/dockerregistry/config.yml
|
||||
Reference in New Issue
Block a user