!/bin/bash image="git.rssa.top/kanzi/dashy" #get timestamp for the tag timestamp=$(date +%Y%m%d%H%M%S) tag=$image:$timestamp latest=$image:latest #build image docker build -t $tag . docker tag $tag $latest #push to dockerhub docker login git.rssa.top #sudo docker login -u username -p password docker push $tag docker push $latest #remove dangling images docker system prune -f