diff --git a/task.go b/task.go index c970362..a08936f 100644 --- a/task.go +++ b/task.go @@ -235,12 +235,12 @@ func Build(buildkitd *Buildkitd, outputsDir string, req Request) (Response, erro func writeDigest(dest string, image v1.Image) error { digestPath := filepath.Join(dest, "digest") - manifest, err := image.Manifest() + digest, err := image.Digest() if err != nil { return errors.Wrap(err, "get image digest") } - err = ioutil.WriteFile(digestPath, []byte(manifest.Config.Digest.String()), 0644) + err = ioutil.WriteFile(digestPath, []byte(digest.String()), 0644) if err != nil { return errors.Wrap(err, "write digest file") } diff --git a/task_test.go b/task_test.go index 5083dc2..2e34426 100644 --- a/task_test.go +++ b/task_test.go @@ -92,10 +92,10 @@ func (s *TaskSuite) TestDigestFile() { image, err := tarball.ImageFromPath(s.imagePath("image.tar"), nil) s.NoError(err) - manifest, err := image.Manifest() + actualDigest, err := image.Digest() s.NoError(err) - s.Equal(string(digest), manifest.Config.Digest.String()) + s.Equal(string(digest), actualDigest.String()) } func (s *TaskSuite) TestDockerfilePath() { @@ -522,17 +522,17 @@ func (s *TaskSuite) TestMultiTargetDigest() { s.NoError(err) digest, err := ioutil.ReadFile(s.outputPath("additional-target", "digest")) s.NoError(err) - additionalManifest, err := additionalImage.Manifest() + additionalDigest, err := additionalImage.Digest() s.NoError(err) - s.Equal(string(digest), additionalManifest.Config.Digest.String()) + s.Equal(string(digest), additionalDigest.String()) finalImage, err := tarball.ImageFromPath(s.imagePath("image.tar"), nil) s.NoError(err) digest, err = ioutil.ReadFile(s.outputPath("image", "digest")) s.NoError(err) - finalManifest, err := finalImage.Manifest() + finalDigest, err := finalImage.Digest() s.NoError(err) - s.Equal(string(digest), finalManifest.Config.Digest.String()) + s.Equal(string(digest), finalDigest.String()) } func (s *TaskSuite) TestMultiTargetUnpack() {