Created
March 12, 2021 07:53
-
-
Save archongum/2c021945b22359dcdd6689895e845d13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REGISTRY="3laho3y3.mirror.aliyuncs.com" | |
FILE_NAME=`basename "$0"` | |
USAGE="Usage: \n\t$FILE_NAME NAME[:TAG|@DIGEST]\n" | |
IMAGE=$1 | |
if [ -z $IMAGE ]; then | |
echo -e $USAGE | |
exit -1 | |
fi | |
docker pull $REGISTRY/$IMAGE | |
if [ $? == 0 ]; then | |
docker tag $REGISTRY/$IMAGE $IMAGE | |
fi | |
if [ $? == 0 ]; then | |
docker rmi $REGISTRY/$IMAGE | |
fi | |
if [ $? == 0 ]; then | |
docker images $IMAGE | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
installation
curl -fsSL https://gitee.com/archongum/codes/wlt7rcv0bdmkiqg8jo4e984/raw?blob_name=docker-pull | sed -e 's/\r//g' > /usr/bin/docker-pull && sudo chmod +x /usr/bin/docker-pull