|
|
|
|
|
by beneills
3509 days ago
|
|
I'm trying this out by deploying my website (static files generated from Jekyll source and served, all in a Docker image). I've written the following instructions for updating the site (build new image, push to Docker Hub, pull into hyper.sh, stop previous container, run new one, attach floating IP). Does it seem reasonable? HYPER_IP=209.177.92.197
LATEST_HASH=$(git log -1 --pretty=format:%h)
IMAGE_NAME=beneills/website:$LATEST_HASH
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME
hyper pull $IMAGE_NAME
hyper run -d -p 80 --name website $IMAGE_NAME
EXISTING_CONTAINER=$(hyper ps --filter name=website --quiet)
hyper stop $EXISTING_CONTAINER
hyper rm $EXISTING_CONTAINER
hyper run --size=s1 -d -p 80 --name website
beneills/website:2994001
hyper fip attach $HYPER_IP website
|
|
LATEST_HASH=$(git rev-parse --short HEAD)
is the more normal way to do that.
It also looks like you'll have downtime due to deleting then running. Eww.