Comments (4)
remote.Layer(digest)
does not fetch the layer from the registry. What is actually first fetching the layer is the call to Cache.Put
when it tries to get the DiffID of the layer here.
from go-containerregistry.
A workaround is to provide a custom DiffID
method that doesn't require the contents of the layer to be computed. (This effectively disables support for auto uncompressing layers though!)
In the example from the description:
type noCompression struct {
v1.Layer
}
func (s noCompression) DiffID() (v1.Hash, error) {
return s.Digest()
}
func main() {
...
layer, err := c.Get(hash)
if err != nil {
...
l, err := remote.Layer(digest)
if err != nil {
panic(err)
}
l2 := noCompression{l}
lazyLayer, err := c.Put(l2)
...
}
from go-containerregistry.
Maybe this is a limitation of the current implementation of the FilesystemCache. Ideally, DiffID should be lazily evaluated. For example, instead of creating a file with the DiffID here, write to a temporary file, then once that's complete, compute the digest and move the file over to the expected location. (This seems like a safer approach anyways.)
However, in order to check if the uncompressed layer is already in the cache, you need to know the DiffID. This is not a problem when caching images because an image config contains the DiffIDs for its layers.
from go-containerregistry.
This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Keep fresh with the 'lifecycle/frozen' label.
from go-containerregistry.
Related Issues (20)
- question: Would you consider this enhancement? HOT 3
- question: How manually configure the go-containerregistry client to use HTTP when accessing a registry HOT 2
- crane: GCR images are not up to date HOT 1
- ggcr: "func (w wrapper) Resolve" ignores errors
- question: support for v1layout tarball?
- crane: MacOS Signed binaries
- question: append with an empty base and environment vars? HOT 3
- question: does this library ensures the integrity of an image downloaded by its digest ?
- crane: fails to load URL-sourced environment credentials
- crane: Enhancements suggest in crane push
- ggcr: `mutate.Extract` does not handle whiteouts of directories properly
- The auth logout command empties all authorized entries HOT 1
- question: Consider distributing crane on conda-forge
- ggcr: creating an empty image index that contains empty image manifest not supported
- crane: cannot push or validate .tar.gz format HOT 3
- crane: Cannot Append Windows Layer Without Duplicate "Files"
- gcrane: unable to transfer images from google container registry to google artifact registry HOT 1
- Getting panic while doing uncompressed HOT 1
- question: How to mutate an image's platform HOT 2
- ggcr: WriteImage race condition on Windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-containerregistry.