Skip to content

Commit

Permalink
Merge pull request #203 from liangyuanpeng/rename_registry
Browse files Browse the repository at this point in the history
Name the registry a special kcl-registry instead of a common registry.
  • Loading branch information
Peefy authored Aug 2, 2024
2 parents 9c5c551 + 3d66bd6 commit 6f36c0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions kind/v1alpha4/kind_x-k8s_io_v1alpha4_cluster.k
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ schema Networking:
podSubnet?: str
ipFamily?: str
kubeProxyMode?: str
disableDefaultCNI?: bool

schema ExtraPortMapping:
containerPort?: int
Expand Down
18 changes: 7 additions & 11 deletions scripts/reg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ mkdir -p ./scripts/registry_auth
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/registry_auth/:/auth/ \
-e "REGISTRY_AUTH=htpasswd" \
Expand All @@ -25,9 +26,4 @@ docker run -p 5001:5000 \
-d registry

# clean the registry
docker exec registry rm -rf /var/lib/registry/docker/registry/v2/repositories/

export LOGIN_WITH_KCL=${LOGIN_WITH_KCL:-"0"}
if [ "$LOGIN_WITH_KCL" = "1" ];then
kcl registry login localhost:5001 -u test -p 1234
fi
docker exec kcl-registry rm -rf /var/lib/registry/docker/registry/v2/repositories/

0 comments on commit 6f36c0c

Please sign in to comment.