From 333f5b45528ac865708e67170758cc81336a28aa Mon Sep 17 00:00:00 2001 From: Lan Liang Date: Fri, 2 Aug 2024 03:58:59 +0000 Subject: [PATCH] Name the registry a special kcl-registry instead of a common registry. Signed-off-by: Lan Liang --- scripts/e2e/reg.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/scripts/e2e/reg.sh b/scripts/e2e/reg.sh index 4ef4124..cd2890c 100755 --- a/scripts/e2e/reg.sh +++ b/scripts/e2e/reg.sh @@ -1,28 +1,29 @@ #!/bin/bash # create a directory to store user passwords -mkdir -p ./scripts/e2e/registry_auth +mkdir -p ./scripts/registry_auth # use htpasswd to create an encrypted file -htpasswd -Bbn test 1234 > ./scripts/e2e/registry_auth/htpasswd +htpasswd -Bbn test 1234 > ./scripts/registry_auth/htpasswd # check if there is a container named registry -if [ "$(docker ps -aq -f name=registry)" ]; then +if [ "$(docker ps -aq -f name=kcl-registry)" ]; then # stop and remove the container named registry - docker stop registry - docker rm registry + docker stop kcl-registry + docker rm kcl-registry fi +export KCL_REGISTRY_PORT=${KCL_REGISTRY_PORT:-"5001"} # start the Docker Registry with authentication -docker run -p 5001:5000 \ +docker run -p ${KCL_REGISTRY_PORT}:5000 \ --restart=always \ ---name registry \ +--name kcl-registry \ -v /var/lib/registry:/var/lib/registry \ --v $PWD/scripts/e2e/registry_auth/:/auth/ \ +-v $PWD/scripts/registry_auth/:/auth/ \ -e "REGISTRY_AUTH=htpasswd" \ -e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \ -e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" \ -d registry # clean the registry -docker exec registry rm -rf /var/lib/registry/docker/registry/v2/repositories/ +docker exec kcl-registry rm -rf /var/lib/registry/docker/registry/v2/repositories/