Skip to content

Instantly share code, notes, and snippets.

@upbeta01
Last active July 25, 2021 03:45
Show Gist options
  • Save upbeta01/bdea18f5803687bb08eb3d25954ec427 to your computer and use it in GitHub Desktop.
Save upbeta01/bdea18f5803687bb08eb3d25954ec427 to your computer and use it in GitHub Desktop.
#!/bin/bash
docker image prune -a -f
eval $(aws ecr get-login --no-include-email --region us-west-2)
j=0
for i in {9000..9003}
do
PORT=$i
COUNT=$((j++))
docker stop FQDN-$COUNT
sleep 10
docker rm FQDN-$COUNT
sleep 10
docker run -d --restart=always --name FQDN-$COUNT -p $PORT:9000 REGISTRY/CONTAINER-IMAGE
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment