File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
# create a directory to store user passwords
4
- mkdir -p ./scripts/e2e/ registry_auth
4
+ mkdir -p ./scripts/registry_auth
5
5
6
6
# 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
8
8
9
9
# 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
11
11
# 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
14
14
fi
15
+ export KCL_REGISTRY_PORT=${KCL_REGISTRY_PORT:- " 5001" }
15
16
16
17
# start the Docker Registry with authentication
17
- docker run -p 5001 :5000 \
18
+ docker run -p ${KCL_REGISTRY_PORT} :5000 \
18
19
--restart=always \
19
- --name registry \
20
+ --name kcl- registry \
20
21
-v /var/lib/registry:/var/lib/registry \
21
- -v $PWD /scripts/e2e/ registry_auth/:/auth/ \
22
+ -v $PWD /scripts/registry_auth/:/auth/ \
22
23
-e " REGISTRY_AUTH=htpasswd" \
23
24
-e " REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm" \
24
25
-e " REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd" \
25
26
-d registry
26
27
27
28
# 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/
You can’t perform that action at this time.
0 commit comments