Docker化bulid指令碼

weixin_34007291發表於2018-12-21
#!/usr/bin/env bash
docker stop $(docker images -a | grep "192.1.1.1:5000" | awk '{print $3 }')
docker stop $(docker ps -a | grep "Exited" | awk '{print $1 }')
docker rm $(docker ps -a | grep "Exited" | awk '{print $1 }')
docker rmi $(docker images | grep "none" | awk '{print $3}')
docker rmi $(docker images -a | grep "192.1.1.1:5000" | awk '{print $3 }')

export REGISTRY_DATA_DIR=/registry/docker/registry/v2
delete_docker_registry_image  --image pay


export REGISTRY_DATA_DIR=/data/registry/docker/registry/v2
delete_docker_registry_image  --image pay

docker build -t 192.1.1.1:5000/log -f /opt/source/log/Dockerfile /opt/source/log

docker push 192.1.1.1:5000/log

相關文章