Closed danielorbach closed 9 months ago
We usually explicitly avoid doing this and let downstream images add those. We had similar requests in the Node image for git to support package manager but if it's added in the base image it can't be removed in subsequent layers.
We appreciate your contribution ❤️🙇
I agree with @LaurentGoderre that the added size would not acceptable for all users of the images. While useful, git-lfs
isn't a core feature of git
but an extension, and as such is not expected to be installed wherever git
is.
For users that need git-lfs
it is as simple as apt-get
(or apk
) installing it or downloading it from https://github.com/git-lfs/git-lfs/releases
in their custom image.
FROM golang:1.21
RUN apt-get update && apt-get install -y git-lfs && rm -rf /var/lib/apt/lists/*
Similar issue/request: https://github.com/docker-library/buildpack-deps/issues/112
Thank you for your response @LaurentGoderre @yosifkit !
Would you like me to amend the Docker image documentation or just leave it as is?
@LaurentGoderre @yosifkit Waiting on you instructions to close this pull-request...
@danielorbach documentation on how to do this would be very welcome!
@LaurentGoderre I'd be glad to extend the documentation!
Can you point me to the appropriate repository? I am a bit lost regarding the many repositories involved.
@yosifkit correct me if im wrong but I think it's this file here: https://github.com/docker-library/docs/blob/master/golang/content.md
This pull-request installs
git-lfs
on the Linux images to support the download of Go modules from private repositories. The following is true even for public repositories that are downloaded directly (as opposed to downloading from a module-proxy).The Go toolchain uses the local git installation to fetch archives of modules from Git servers directly. My company commits large files using Git LFS which happen to be part of our Go module source tree. Without git-lfs installed, the local git installation does not automatically resolve those files which causes "checksum mismatch" against the committed
go.sum
.@yosifkit I have tested that the generated images in-fact resolve the Issue. I'd appreciate your review. Looking for your guidance on getting this enhancement to the community,