Skip to content

Commit

Permalink
Merge pull request #2 from 01-edu/DEV-3247-automate-re-starting-docke…
Browse files Browse the repository at this point in the history
…r-registry´

feat(registry): automate re-start docker registry
  • Loading branch information
Frenchris authored Jul 27, 2022
2 parents 662b512 + 1095984 commit 182f6c1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions restartRegistry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

IFS='
'
cd -P "$(dirname "$0")"

# Stop and remove registry container
docker container stop registry && docker container rm registry

# Kill processes using port 8081 (registry service)
kill -9 $(lsof -t -i:8081)

# Re-create and run the registry contianer
docker run --detach --publish 5000:5000 --restart=unless-stopped --name registry --volume registry:/var/lib/registry registry:2.7.1

# Relaunch registry service
./registry -port 8081 2>log.txt &

0 comments on commit 182f6c1

Please sign in to comment.