22 lines
404 B
Bash
22 lines
404 B
Bash
!/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 |