Skip to content

Commit 35a241a

Browse files
author
Harry
committed
feat(registry) automate re-start docker registry
1 parent 662b512 commit 35a241a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

restartRegistry.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
3+
IFS='
4+
'
5+
cd -P "$(dirname "$0")"
6+
7+
# Stop and remove registry container
8+
docker container stop registry && docker container rm registry
9+
10+
# Kill processes using port 8081 (registry service)
11+
kill -9 $(lsof -t -i:8081)
12+
13+
# Re-create and run the registry contianer
14+
docker run --detach --publish 5000:5000 --restart=unless-stopped --name registry --volume registry:/var/lib/registry registry:2.7.1
15+
16+
# Relaunch registry service
17+
./registry -port 8081 2>log.txt &

0 commit comments

Comments
 (0)