Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for git-lfs #312

Closed
roim opened this issue Mar 3, 2021 · 11 comments
Closed

No support for git-lfs #312

roim opened this issue Mar 3, 2021 · 11 comments
Labels
kind/upstream Changes need to be made on upstream project

Comments

@roim
Copy link

roim commented Mar 3, 2021

Behaviour

Steps to reproduce this issue

  1. Set up a repository with files tracked by git-lfs (e.g. add a png image to a repo and git lfs track "*.png").
  2. COPY those files in your Dockerfile.
  3. Use this action to build that Dockerfile.

Expected behaviour

Docker image contains the file tracked by git-lfs.

Actual behaviour

Docker image contains the git-lfs pointer.

Configuration

Happens on the current README config.

More

  1. This is extra confusing because any actions/checkout runs with lfs: true are ignored since this action is doing its own checkout. E.g. see this on stack overflow--there are several other reports scattered around.

  2. Separately, DockerHub also lacks git-lfs support, that is mentioned in its docs and also in this Issue: Add support for Git LFS. hub-feedback#500

@roim
Copy link
Author

roim commented Mar 3, 2021

As a mitigation, this action uses whatever is checked out with actions/checkout@v2 which can be configured to use lfs: https://github.com/elgohr/Publish-Docker-Github-Action

@crazy-max
Copy link
Member

@roim Do you have a link to your repo for repro please? You can use the Path context (with checkout action) in the meantime.

@roim
Copy link
Author

roim commented Mar 3, 2021

@crazy-max it's a private one but I can set up a public repro tomorrow. And thanks for the tip on path context, I'll test it but that should work as a cleaner mitigation.

@roim
Copy link
Author

roim commented Mar 4, 2021

Repro here: https://github.com/roim/docker-action-lfs

Check how a cat on the image tracked by lfs yields the lfs pointer: https://github.com/roim/docker-action-lfs/runs/2027422788?check_suite_focus=true

That said, passing a custom context, and setting up an lfs checkout beforehand, will work.

I'm sure it's not practical to support every git extension, but lfs is fairly standard and supported by the github checkout action. Maybe an example or comment in the readme would be enough?

roim referenced this issue in roim/docker-action-lfs Mar 4, 2021
@crazy-max
Copy link
Member

crazy-max commented Mar 9, 2021

Ok looks like it's not implemented on buildkit. Would need a specific option to enable this feature. The command would look like git lfs install --local. WDYT @tonistiigi?

@crazy-max crazy-max added the kind/upstream Changes need to be made on upstream project label Mar 9, 2021
@geokaragiannis
Copy link

Are there any updates on this? :)

@Mluckydwyer
Copy link

Any updates on this?

@Mluckydwyer
Copy link

For anyone else with this issue, see this repo for a workaround:
https://github.com/roim/docker-action-lfs

@cupcakearmy
Copy link

cupcakearmy commented Nov 20, 2022

For anyone else with this issue, see this repo for a workaround: https://github.com/roim/docker-action-lfs

Thanks, made my day. context: . was the trick.

redshiftzero added a commit to penumbra-zone/penumbra that referenced this issue Feb 25, 2023
According to [0] if we pass in a custom context with git
lfs enabled then the build should work.

[0] docker/build-push-action#312
redshiftzero added a commit to penumbra-zone/penumbra that referenced this issue Feb 25, 2023
According to [0] if we pass in a custom context with git
lfs enabled then the build should work.

[0] docker/build-push-action#312
maeb added a commit to nlnwa/solrwayback-adaption that referenced this issue Sep 8, 2023
This commit configures docker/build-push-action to use path
context in order to get git-lfs working.

See docker/build-push-action#312 for
context.
@thompson-shaun
Copy link
Contributor

closing as complete

@danielorbach
Copy link

danielorbach commented Nov 7, 2024

closing as complete

@thompson-shaun thank you for the update 🎉 can you please reference the relevant pull request or version of the action that supports LFS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/upstream Changes need to be made on upstream project
Projects
None yet
Development

No branches or pull requests

7 participants