将 Dockerfile 中的多个子模块方案从 git 转为 https

我有一个要克隆的仓库,其中包含多个子模块。可以通过运行以下命令来显示子模块: git config --file=.gitmodules -l 运行结果如下:

submodule.third-party/lua-resty-lrucache.path=third-party/lua-resty-lrucache
submodule.third-party/lua-resty-lrucache.url=git@github.com:openresty/lua-resty-lrucache.git
submodule.third-party/oxd-web-lua.path=third-party/oxd-web-lua
submodule.third-party/oxd-web-lua.url=git@github.com:GluuFederation/oxd-web-lua.git
submodule.third-party/json-logic-lua.path=third-party/json-logic-lua
submodule.third-party/json-logic-lua.url=https://git.rucciva.one/rucciva/json-logic-lua.git
submodule.third-party/lua-resty-jwt.path=third-party/lua-resty-jwt
submodule.third-party/lua-resty-jwt.url=git@github.com:altexy/lua-resty-jwt.git
submodule.third-party/lua-resty-hmac.path=third-party/lua-resty-hmac
submodule.third-party/lua-resty-hmac.url=git@github.com:jkeys089/lua-resty-hmac.git
submodule.third-party/nginx-lua-prometheus.path=third-party/nginx-lua-prometheus
submodule.third-party/nginx-lua-prometheus.url=git@github.com:knyar/nginx-lua-prometheus.git
submodule.third-party/lua-resty-session.path=third-party/lua-resty-session
submodule.third-party/lua-resty-session.url=git@github.com:bungle/lua-resty-session.git

我不想在克隆时使用 SSH,因为我想启用 DockerHub 自动构建。我只想将所有git@github.com方案转换为https://...

我尝试使用git config --file=.gitmodules submodules.Submod.url https://github.com/jkeys089/lua-resty-hmac.git但不确定如何转换所有子模块,更不用说一个子模块。

如何将所有子模块的方案从git转换为https在Dockerfile中?

点赞