Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name the registry a special kcl-registry instead of a common registry. #121

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions scripts/e2e/reg.sh
Original file line number Diff line number Diff line change
@@ -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/
Loading