buildah icon indicating copy to clipboard operation
buildah copied to clipboard

Support for ADD <git ref> in Containerfile

Open dustymabe opened this issue 11 months ago • 18 comments

It seems Dockerfile supports adding a git repo files via:

ADD [--keep-git-dir=<boolean>] <git ref> <dir>

https://docs.docker.com/engine/reference/builder/#adding-a-git-repository-add-git-ref-dir

Do we support that? Can we support that?

dustymabe avatar Aug 12 '23 04:08 dustymabe

@dustymabe Thanks for creating the issue.

Do we support that?

Afaik No, buildah supports adding contents from remote URL but it does not treats git or git ref as a special case. @nalind Could you confirm please.

Can we support that ?

Sure this can be implemented.

flouthoc avatar Aug 12 '23 11:08 flouthoc

ADD doesn't do any special handling for what look like Git repository locations, no.

nalind avatar Aug 14 '23 12:08 nalind

If docker supports it, so should we.

rhatdan avatar Aug 14 '23 17:08 rhatdan

Mind If I take a look at this?

danishprakash avatar Sep 12 '23 11:09 danishprakash

SGTM

rhatdan avatar Sep 12 '23 18:09 rhatdan

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Oct 13 '23 00:10 github-actions[bot]

@danishprakash any progress?

rhatdan avatar Oct 13 '23 01:10 rhatdan

Not yet, I'll take a look at it end of next week.

danishprakash avatar Oct 18 '23 02:10 danishprakash

A friendly reminder that this issue had no activity for 30 days.

github-actions[bot] avatar Nov 18 '23 00:11 github-actions[bot]

I might take a stab at this if @danishprakash has more important stuff to do.

jfroy avatar Nov 30 '23 18:11 jfroy

After 30 days it is up for grabs. go for it.

rhatdan avatar Dec 01 '23 00:12 rhatdan

Would love to see this feature make it to buildah and eventually podman. Docker's been supporting it since a while and it's not under any sort of experimental flag.

douglascamata avatar Mar 01 '24 13:03 douglascamata

In the mean time, do any of you have a suggested workaround that's not going to mess up image layer caching (like git clone) and stays within the Dockerfile?

douglascamata avatar Mar 01 '24 13:03 douglascamata

@jfroy did you ever get a chance to work on it?

rhatdan avatar Mar 02 '24 18:03 rhatdan

Not yet, haven't had the time.

jfroy avatar Mar 03 '24 02:03 jfroy

I think most of the code is in something like:

path, subdir, err := define.TempDirForURL(tmpdir.GetTempDir(), internal.BuildahExternalArtifactsDir, src)

rhatdan avatar Mar 04 '24 01:03 rhatdan

I can start looking at it now, is this still open?

danishprakash avatar Mar 14 '24 13:03 danishprakash

I can start looking at it now, is this still open?

Yep, I haven't started! Take it.

jfroy avatar Mar 14 '24 17:03 jfroy