mirror_rep_tool

pushimage.sh

What to do: Pull image, retag, push to tmp rep. Run in the server could pull image

Set env var DOCKER_MIRROR_REP into ~/.bashrc

echo "export DOCKER_MIRROR_REP=<transfer registry>/<namespace>/<imagename>" >> ~/.bashrc
source ~/.bashrc

Install pushimage

sudo curl -Lo /usr/local/bin/pushimage https://raw.githubusercontent.com/LQBing/mirror_rep_tool/main/pushimage.sh
sudo chmod +x /usr/local/bin/pushimage

or

git clone https://github.com/LQBing/mirror_rep_tool.git
cd mirror_rep_tool
cp pushimage.sh /usr/local/bin/pushimage
sudo chmod +x /usr/local/bin/pushimage

Push image to mirror repo

pushimage mongo:5.0

pullimage.sh

What to do: pull image from tmp rep, retag. Run in the server could not pull image

Set env var DOCKER_MIRROR_REP into ~/.bashrc

echo "export DOCKER_MIRROR_REP=<transfer registry>/<namespace>/<imagename>" >> ~/.bashrc
echo "export DOCKER_TRANSPORT_SERVER_HOST=<your transport server host>" >> ~/.bashrc
source ~/.bashrc

Install pullimage

sudo curl -Lo /usr/local/bin/pullimage https://raw.githubusercontent.com/LQBing/mirror_rep_tool/main/pullimage.sh
sudo chmod +x /usr/local/bin/pullimage

or

git clone https://github.com/LQBing/mirror_rep_tool.git
cd mirror_rep_tool
cp pullimage.sh /usr/local/bin/pullimage
sudo chmod +x /usr/local/bin/pullimage

Pull image

bash pullimage.sh mongo:5.0

Clean images

Your server disk is limited, sometime you need clean it.

remove images

docker rmi mongo:5.0
docker rmi <yourrep>/<namespace>/<imagename>:library_mongo_5.0

or just clean all

docker system prune -af