Skip to content

Commit

Permalink
Remove tarball.WithCompressedCaching flag to resolve OOM Killed error
Browse files Browse the repository at this point in the history
Fixes GoogleContainerTools#1680
Large images cannot be build as the kaniko container will be killed due to an OOM error
Removing the tarball compression drastically reduces the memory required to push large image layers
  • Loading branch information
Phylu committed Aug 13, 2021
1 parent 7e3954a commit 9a9764e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/executor/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func (s *stageBuilder) saveSnapshotToLayer(tarPath string) (v1.Layer, error) {
return nil, nil
}

layer, err := tarball.LayerFromFile(tarPath, tarball.WithCompressedCaching)
layer, err := tarball.LayerFromFile(tarPath)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/executor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func writeImageOutputs(image v1.Image, destRefs []name.Tag) error {
// pushLayerToCache pushes layer (tagged with cacheKey) to opts.Cache
// if opts.Cache doesn't exist, infer the cache from the given destination
func pushLayerToCache(opts *config.KanikoOptions, cacheKey string, tarPath string, createdBy string) error {
layer, err := tarball.LayerFromFile(tarPath, tarball.WithCompressedCaching)
layer, err := tarball.LayerFromFile(tarPath)
if err != nil {
return err
}
Expand Down

0 comments on commit 9a9764e

Please sign in to comment.