Docker build 在线地址错误异常解决

今天准备通过在线地址docker build Gitlab的时候发现出错

[root@DT_Node-172_30_200_213 ~]# docker build -t benyoo/gitlab:15.3.1 https://github.com/sameersbn/docker-gitlab.git
unable to prepare context: unable to 'git clone' to temporary context directory: error initializing submodules: usage: git submodule [--quiet] add [-b <branch>] [-f|--force] [--name <name>] [--reference <repository>] [--] <repository> [<path>]
   or: git submodule [--quiet] status [--cached] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] init [--] [<path>...]
   or: git submodule [--quiet] deinit [-f|--force] [--] <path>...
   or: git submodule [--quiet] update [--init] [--remote] [-N|--no-fetch] [-f|--force] [--rebase] [--reference <repository>] [--merge] [--recursive] [--] [<path>...]
   or: git submodule [--quiet] summary [--cached|--files] [--summary-limit <n>] [commit] [--] [<path>...]
   or: git submodule [--quiet] foreach [--recursive] <command>
   or: git submodule [--quiet] sync [--recursive] [--] [<path>...]
: exit status 1
[root@DT_Node-172_30_200_213 ~]# git version
git version 1.8.3.1
[root@DT_Node-172_30_200_213 ~]# 

解决方法添加第三方源安装高版本git

[root@DT_Node-172_30_200_213 ~]# yum remove git
[root@DT_Node-172_30_200_213 ~]# yum install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm -y
[root@DT_Node-172_30_200_213 ~]# yum install -y git
[root@DT_Node-172_30_200_213 ~]# git version
git version 2.37.1
[root@DT_Node-172_30_200_213 ~]# 
lookback
  • 本文由 发表于 2022年9月1日05:28:02
  • 除非特殊声明,本站文章均为原创,转载请务必保留本文链接
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: