Skip to content

Commit ee196e2

Browse files
authored
Merge pull request #121 from liangyuanpeng/rename_registry
Name the registry a special kcl-registry instead of a common registry.
2 parents 8e479b3 + 333f5b4 commit ee196e2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

scripts/e2e/reg.sh

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
#!/bin/bash
22

33
# create a directory to store user passwords
4-
mkdir -p ./scripts/e2e/registry_auth
4+
mkdir -p ./scripts/registry_auth
55

66
# use htpasswd to create an encrypted file
7-
htpasswd -Bbn test 1234 > ./scripts/e2e/registry_auth/htpasswd
7+
htpasswd -Bbn test 1234 > ./scripts/registry_auth/htpasswd
88

99
# check if there is a container named registry
10-
if [ "$(docker ps -aq -f name=registry)" ]; then
10+
if [ "$(docker ps -aq -f name=kcl-registry)" ]; then
1111
# stop and remove the container named registry
12-
docker stop registry
13-
docker rm registry
12+
docker stop kcl-registry
13+
docker rm kcl-registry
1414
fi
15+
export KCL_REGISTRY_PORT=${KCL_REGISTRY_PORT:-"5001"}
1516

1617
# start the Docker Registry with authentication
17-
docker run -p 5001:5000 \
18+
docker run -p ${KCL_REGISTRY_PORT}:5000 \
1819
--restart=always \
19-
--name registry \
20+
--name kcl-registry \
2021
-v /var/lib/registry:/var/lib/registry \
21-
-v $PWD/scripts/e2e/registry_auth/:/auth/ \
22+
-v $PWD/scripts/registry_auth/:/auth/ \
2223
-e "REGISTRY_AUTH=htpasswd" \
2324
-e "REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
2425
-e "REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" \
2526
-d registry
2627

2728
# clean the registry
28-
docker exec registry rm -rf /var/lib/registry/docker/registry/v2/repositories/
29+
docker exec kcl-registry rm -rf /var/lib/registry/docker/registry/v2/repositories/

0 commit comments

Comments
 (0)