Skip to content

Support ADD cloning git repository recursive submodules via SSH #6075

@MisterDA

Description

@MisterDA

Description

The Dockerfile ADD instruction can add files from a git repository. My understanding is that it improves caching over RUN git clone.

To add a repository via SSH, whether public or private, you must pass an SSH key for authentication.

ADD [email protected]:user/repo.git /usr/src/things/

If however the git repository submodules can only be fetched via ssh, then, unless I'm mistaken, ADD is unable to fetch them. One has to resort to ssh mounts to be able to do RUN --mount=type=ssh git clone --recursive ....

Could ADD be enhanced to fetch the submodules via SSH, too?

Thanks!

Metadata

Metadata

Assignees

Projects

Status

Needs author feedback

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions