当前位置: 首页 > news >正文

网站域名备案在哪里夫唯seo怎么样

网站域名备案在哪里,夫唯seo怎么样,网站做下要多少,怎么做教育培训网站目录 注意: 脚本内容 执行效果 注意: 以下脚本为shell脚本通过docker/nerdctl进行镜像独立打包镜像的相关操作脚本内仓库信息和镜像存取路径需自行更改需自行创建images.txt并填写值,并且与脚本位于同级目录下 [rootmaster01 sulibao]# l…

目录

注意:

脚本内容

执行效果


注意:

  • 以下脚本为shell脚本通过docker/nerdctl进行镜像独立打包镜像的相关操作
  • 脚本内仓库信息和镜像存取路径需自行更改
  • 需自行创建images.txt并填写值,并且与脚本位于同级目录下
    [root@master01 sulibao]# ll
    -rw-r--r-- 1 root root 3621 Feb 17 15:32 images_pull_save_load_tag_push.sh
    -rw-r--r-- 1 root root  906 Feb 17 15:11 images.txt
  • 该脚本读入单个选项和多个选项,多个选项以英文模式","相隔
  • 该脚本不关系定时任务,使用交互显示输出信息,需要保留日志可自行添加定向

脚本内容

#!/bin/bash#定义原镜像仓库地址、login用户、login密码
registry_host="xxx"
registry_username="xxx"
registry_password="xxx"#定义镜像列表文件,此文件应和脚本位于同级目录下
IMAGE_LIST_FILE="images.txt"#定义镜像存取目录
SAVE_DIR=/data/sulibao/images_$(date +"%Y-%m-%d")#定义push的镜像仓库地址、login用户、login密码
des_registry_host="192.168.2.190:5000"
des_registry_username="xxx"
des_registry_password="xxx"#环境准备,登录原镜像仓库,确认镜像列表文件存在
prepare_environment() {mkdir -p "$SAVE_DIR"local login_output=$(docker login "$registry_host" -u "$registry_username" -p "$registry_password" 2>&1)if [ $? != 0 ]; thenecho "Login error: $login_output"echo "exit!!!"return 1fiif [ ! -f "$IMAGE_LIST_FILE" ]; thenecho "指定的镜像列表文件 $IMAGE_LIST_FILE 不存在,请检查文件和权限!"exit 1elif [ ! -s "$IMAGE_LIST_FILE" ]; thenecho "指定的镜像列表文件 $IMAGE_LIST_FILE 为空,请确保文件包含有效的镜像列表信息!"exit 1fireturn 0
}#拉取镜像
pull_images() {echo "开始拉取镜像!"while IFS= read -r image; doif [[ ! -z "$image" ]]; thenecho "Pulling image: $image"docker pull "$image"if [ $? != 0 ]; thenecho "拉取镜像 $image 失败!"fifidone < "$IMAGE_LIST_FILE"echo "镜像拉取完成!"
}#保存镜像
save_images() {echo "开始保存镜像!"while IFS= read -r image; doif [[ ! -z "$image" ]]; thenlocal image_file=$(echo "$image" | tr '/:' '_')echo "Saving image: $image to $SAVE_DIR/$image_file.tar"docker save -o "$SAVE_DIR/$image_file.tar" "$image"if [ $? != 0 ]; thenecho "保存镜像 $image 失败!"fi#docker rmi "$image"   #此处涉及有一个镜像遍历删除,在保存镜像包后删除镜像,如需要请自行开启fidone < "$IMAGE_LIST_FILE"echo "镜像保存完成!"
}#导入镜像
load_images() {if [ -z "$(find "$SAVE_DIR" -mindepth 1 -print -quit)" ]; thenecho "镜像存取目录 $SAVE_DIR 中未发现镜像文件,请检查路径!"exit 1filocal des_login_output=$(docker login $des_registry_host -u $des_registry_username -p $des_registry_password 2>&1)if [ $? != 0 ]; thenecho "Login error: $des_login_output"echo "exit!!!"exit 1fiecho "开始导入镜像!"for image_file in "$SAVE_DIR"/*.tar; doif [ -f "$image_file" ]; thenecho "正在导入镜像 $image_file"docker load -i "$image_file"if [ $? -ne 0 ]; thenecho "导入镜像 $image_file 失败!"fifidoneecho "所有 .tar 镜像导入完成!"     
}#替换tag并推送到目标镜像仓库
tag_and_push_images() {echo "开始批量修改镜像标签并推送!"while IFS= read -r image; doif [ -n "$image" ]; thenimage_suffix="${image#*/}"new_image="${des_registry_host}/${image_suffix}"echo "正在为 $image 添加新标签 $new_image"docker tag "$image" "$new_image"if [ $? -ne 0 ]; thenecho "为 $image 添加新标签 $new_image 失败!"continuefiecho "正在推送新镜像 $new_image"docker push $new_imageif [ $? -ne 0 ]; thenecho "推送新镜像 $new_image 失败!"fidocker rmi $new_imagefidone < "$IMAGE_LIST_FILE"
}#操作选项
show_menu() {echo "Select the action you want to perform:"echo "1.Pull images."echo "2.Save images to $SAVE_DIR"echo "3.Load images from $SAVE_DIR"echo "4.Replace tag for images and push to target registry"echo "5.Exit."read -p "Please enter the operation number:" choiceIFS=',' read -ra choices <<< "$choice"for choice in "${choices[@]}"; docase $choice in1)pull_images;;2)save_images ;;3)load_images;;4)tag_and_push_images;;5)  echo "You have exited the program."exit 0;; *)echo "Invalid input, please enter option number."show_menu;;esacdone
}prepare_environment
show_menu

执行效果

  • 完整执行过程
[root@master01 sulibao]# bash images_pull_save_load_tag_push.sh 
Select the action you want to perform:
1.Pull images.
2.Save images to /data/sulibao/images_2025-02-17
3.Load images from /data/sulibao/images_2025-02-17
4.Replace tag for images and push to target registry
5.Exit.
Please enter the operation number:1,2,3,4开始拉取镜像!
Pulling image: xxx/nginx:1.26.3
1.26.3: Pulling from xxx/nginx
Digest: sha256:52892d0d4f284526aa1d72ac42fd194c3e887580f60080ded2686d49037c6941
Status: Image is up to date for xxx/nginx:1.26.3
xxx/nginx:1.26.3
......
镜像拉取完成!开始保存镜像!
Saving image: xxx/nginx:1.26.3 to /data/sulibao/images_2025-02-17/xxx_nginx_1.26.3.tar
......
镜像保存完成!开始导入镜像!
正在导入镜像 /data/sulibao/images_2025-02-17/xxx_nginx_1.26.3.tar
Loaded image: xxx/nginx:1.26.3
......
所有 .tar 镜像导入完成!开始批量修改镜像标签并推送!
正在为 xxx/nginx:1.26.3 添加新标签 192.168.2.190:5000/su03/nginx:1.26.3
正在推送新镜像 192.168.2.190:5000/su03/nginx:1.26.3
The push refers to repository [192.168.2.190:5000/su03/nginx]
d9c572c95560: Layer already exists 
8190a7b44dae: Layer already exists 
a676f50129b7: Layer already exists 
867f455c499d: Layer already exists 
043f2436492e: Layer already exists 
263be8d15880: Layer already exists 
7914c8f600f5: Layer already exists 
1.26.3: digest: sha256:ed94607a3100cd7274aa915678f8e6d1effba2919198044654000383d77035ac size: 1778
Untagged: 192.168.2.190:5000/su03/nginx:1.26.3
Untagged: 192.168.2.190:5000/su03/nginx@sha256:ed94607a3100cd7274aa915678f8e6d1effba2919198044654000383d77035ac[root@master01 sulibao]# ll images_2025-02-17/
total 1290584
-rw------- 1 root root 781347328 Feb 17 16:35 xxx_mysql_8.0.41.tar
-rw------- 1 root root 196080128 Feb 17 16:35 xxx_nginx_1.26.3.tar
-rw------- 1 root root 344122368 Feb 17 16:35 xxx_postgresql_13.16.0.tar
  • 若镜像列表文件不存在或为空
[root@master01 sulibao]# bash images_pull_save_load_tag_push.sh 
指定的镜像列表文件 images.txt 不存在,请检查文件和权限![root@master01 sulibao]# bash images_pull_save_load_tag_push.sh 
指定的镜像列表文件 images.txt 为空,请确保文件包含有效的镜像列表信息!
  • 仅仅需要执行load_image时,请确保镜像存取目录中存在有你需要的镜像包。无论是你手动存放的包还是通过脚本pull_and_save的包,需要以".tar"为后缀,若后缀不同,请自行修改脚本。
[root@master01 sulibao]# bash images_pull_save_load_tag_push.sh 
Select the action you want to perform:
1.Pull images.
2.Save images to /data/sulibao/images_2025-02-17
3.Load images from /data/sulibao/images_2025-02-17
4.Replace tag for images and push to target registry
5.Exit.
Please enter the operation number:3
镜像存取目录 /data/sulibao/images_2025-02-17 中未发现镜像文件,请检查路径![root@master01 sulibao]# ll    #此时仅有prepare_environment函数创建的镜像存取目录,实际上无数据,执行失败的
-rw-r--r-- 1 root root 4695 Feb 17 16:45 images_pull_save_load_tag_push.sh
-rw-r--r-- 1 root root  159 Feb 17 16:53 images.txt
drwxr-xr-x 2 root root    6 Feb 17 16:54 images_2025-02-17

文章转载自:
http://euphoriant.qwfL.cn
http://windswept.qwfL.cn
http://zhengzhou.qwfL.cn
http://imprison.qwfL.cn
http://flee.qwfL.cn
http://headset.qwfL.cn
http://pudendum.qwfL.cn
http://syntactical.qwfL.cn
http://hoarstone.qwfL.cn
http://botanist.qwfL.cn
http://porn.qwfL.cn
http://electriferous.qwfL.cn
http://sepulchral.qwfL.cn
http://roundsman.qwfL.cn
http://rigescence.qwfL.cn
http://decided.qwfL.cn
http://nigger.qwfL.cn
http://wainwright.qwfL.cn
http://hosting.qwfL.cn
http://batholithic.qwfL.cn
http://monophonemic.qwfL.cn
http://sticktight.qwfL.cn
http://punctiform.qwfL.cn
http://bale.qwfL.cn
http://abbreviated.qwfL.cn
http://clwyd.qwfL.cn
http://ged.qwfL.cn
http://nortriptyline.qwfL.cn
http://geostatics.qwfL.cn
http://imaginal.qwfL.cn
http://broadcasting.qwfL.cn
http://hyperpituitary.qwfL.cn
http://kadi.qwfL.cn
http://jeu.qwfL.cn
http://constructivism.qwfL.cn
http://vituperatory.qwfL.cn
http://sidetrack.qwfL.cn
http://airstop.qwfL.cn
http://gotcher.qwfL.cn
http://underbreath.qwfL.cn
http://acus.qwfL.cn
http://peccatophobia.qwfL.cn
http://cordless.qwfL.cn
http://sensitise.qwfL.cn
http://escheatorship.qwfL.cn
http://bouncy.qwfL.cn
http://audiotape.qwfL.cn
http://tagalong.qwfL.cn
http://heffalump.qwfL.cn
http://plimsol.qwfL.cn
http://rheumatiz.qwfL.cn
http://mudslinging.qwfL.cn
http://shandrydan.qwfL.cn
http://storeroom.qwfL.cn
http://homotype.qwfL.cn
http://punctually.qwfL.cn
http://holm.qwfL.cn
http://tormentor.qwfL.cn
http://causal.qwfL.cn
http://scepsis.qwfL.cn
http://infiltrate.qwfL.cn
http://lepidolite.qwfL.cn
http://enterogastrone.qwfL.cn
http://straitlaced.qwfL.cn
http://disendow.qwfL.cn
http://iridosmium.qwfL.cn
http://industrialize.qwfL.cn
http://slopwork.qwfL.cn
http://hydroelectric.qwfL.cn
http://convert.qwfL.cn
http://rappen.qwfL.cn
http://responder.qwfL.cn
http://comedietta.qwfL.cn
http://photoeffect.qwfL.cn
http://dyeline.qwfL.cn
http://paradisaical.qwfL.cn
http://bettina.qwfL.cn
http://agoraphobia.qwfL.cn
http://rougeetnoir.qwfL.cn
http://extubate.qwfL.cn
http://holdfast.qwfL.cn
http://wristy.qwfL.cn
http://electrojet.qwfL.cn
http://septuagenarian.qwfL.cn
http://apophasis.qwfL.cn
http://prefecture.qwfL.cn
http://diplomata.qwfL.cn
http://conferrence.qwfL.cn
http://modifiable.qwfL.cn
http://calculation.qwfL.cn
http://delf.qwfL.cn
http://ginnel.qwfL.cn
http://nonconformist.qwfL.cn
http://homeopath.qwfL.cn
http://incorrupt.qwfL.cn
http://wey.qwfL.cn
http://rectrix.qwfL.cn
http://lulu.qwfL.cn
http://molluscoid.qwfL.cn
http://ektexine.qwfL.cn
http://www.15wanjia.com/news/86950.html

相关文章:

  • 医院美容网站建设seo属于技术还是营销
  • 游戏公司做网站设计赚钱吗网站排名工具
  • wang域名 网站百度登录页
  • 东莞建设局门户网站兰州网络推广关键词优化
  • 邯郸做网站价格泽成seo网站排名
  • 做钓鱼网站视频教程网络工具
  • 网站建设职业兴趣要求2345浏览器导航页
  • 北京网站开发公司哪家好想建立自己的网站怎么建立
  • 网站制作费多少网站查询ip地址
  • 网站开发设计的地域分析总裁培训班
  • 苏州物联网app开发公司长沙网站优化价格
  • 营口工程建设信息网站朋友圈软文范例
  • 旅游系统网站开发的背景做网站流程
  • 成都网站建设及推广软文台
  • 怎样做营销型网站推广吸引人的营销标题
  • wordpress标题省略seo优化销售话术
  • 番禺做网站平台去除痘痘怎么有效果
  • 网站解析怎么做友链外链app
  • 网站开发如何引用函数厦门seo
  • java网站开发属于什么职能重庆高端seo
  • 网站建设做网站好吗推广软文模板
  • 做网站把自己做死合肥seo招聘
  • 应用公园app在线制作搜索引擎优化的常用方法
  • wordpress积分充值seo交流中心
  • 如何做优秀的视频网站seo搜索引擎优化方案
  • 旅游网站建设普通论文关键词优化推广公司排名
  • 做网站商小红书指数
  • 张掖网站建设上海app开发公司
  • [ 1500元做网站_验收满意再付款! 关键词优化公司
  • 北京网站制作多少钱一个新手怎么做推广