build-push-action
build-push-action copied to clipboard
No support for git-lfs
Behaviour
Steps to reproduce this issue
- Set up a repository with files tracked by git-lfs (e.g. add a png image to a repo and
git lfs track "*.png"
). -
COPY
those files in your Dockerfile. - 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
-
This is extra confusing because any
actions/checkout
runs withlfs: 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. -
Separately, DockerHub also lacks git-lfs support, that is mentioned in its docs and also in this Issue: https://github.com/docker/hub-feedback/issues/500
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
@roim Do you have a link to your repo for repro please? You can use the Path context (with checkout action) in the meantime.
@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.
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?
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?
Are there any updates on this? :)
Any updates on this?
For anyone else with this issue, see this repo for a workaround: https://github.com/roim/docker-action-lfs
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.