Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Krumshtein committed Feb 24, 2020
1 parent 2b9768c commit d4b86c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/builder/step/from_step.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,14 @@ func (s *FromStep) GetAlias() string {
func (s *FromStep) SetCacheID(ctx *context.BuildContext, seed string) error {
manifest, err := s.getManifest(ctx.ImageStore)
if err != nil {
return fmt.Errorf("get manifest: %s", err)
log.Infof("Could not get manifest: %s. Using hash of from directive as cacheID.", err)
checksum := crc32.ChecksumIEEE([]byte(seed + string(s.directive)))
s.cacheID = fmt.Sprintf("%x", checksum)
return nil
}
layerDigest := ""
for _, layer := range manifest.Layers {
log.Infof("Layers digest " + layer.Digest.Hex())
layerDigest += string(layer.Digest)
}
checksum := crc32.ChecksumIEEE([]byte(seed + layerDigest))
Expand Down

0 comments on commit d4b86c3

Please sign in to comment.