Loading

Docker镜像相关操作

批量导入镜像

ll *.tgz|awk '{print $NF}'|sed -r 's#(.*)#docker load -i \1#' |bash

批量打tag

docker images | sed 's/gcr.io\/google_containers\//harbor.test.com\/kubernetes_images\//' | awk '{print "docker tag "$3" "$1":"$2}' | tail -6 | sh 

批量推送

docker images | grep goodrain.me | awk '{print "docker push "$1":"$2}' | sh

批量导入到一个压缩包

#!/bin/bash
IMAGES_LIST=($(docker  images   | sed  '1d' | awk  '{print $1":"$2}'))
docker save ${IMAGES_LIST[*]}  -o  all-images.tar.gz
posted @ 2021-05-06 16:12  亚里士多智  阅读(89)  评论(0编辑  收藏  举报