Submodule management (URLs) and docker images
When you add a sub-module, the URL uses the url that you used to add the submodule. For 2dFdr, this was done with lines like
git submodule add ``https://dev.aao.org.au/rds/slalib_o.git
The result is that an entry is made in .gitmodules like this
[submodule "slalib_o"]
path = slalib_o
url = https://dev.aao.org.au/rds/slalib_o.git
The problem with this is that if you try to install in a Docker image, you may not have the credentials to install the sub-modules
First, you probably want to clone using:
git clone --recurse-submodules <<url>>
This will attempt to fetch the sub-modules. But as you have specified via the "add" command a particular URL, that is how it will be fetched and you will need to add the credentials. This is a real mess if you need to use 2FA, but even without that it is a problem.
What you can do is use relative sub-module locations. I haven't tried to use that when adding a new sub-module as yet, but we need to fix older systems like 2dFdr.
Here is another example of a submodule specification in .gitmodules
[submodule "drtf"]
path = drtf
url = git@dev.aao.org.au:rds/inst/aao2ctrl/drtf.git
(This one used ssh authentication instead of https)
I was using this in a module in https://dev.aao.org.au/tjf/tjftest
The fix was to change the above to
[submodule "drtf"]
path = drtf
url = ../../rds/inst/aao2ctrl/drtf.git
Only the "url" line is changed. It is now finding the sub-module relative to the path to the module itself "tjf/tjftest".
With this change, the authentication used is that used the main module and everything will work when you do
git clone --recurse-submodules ...
So - each of the entries in 2dfdr/.gitsubmodule needs to be modified in a similar fashion.