@@ -24,6 +24,7 @@ import (
2424 "github.com/docker/docker/pkg/progress"
2525 "github.com/docker/docker/pkg/stringid"
2626 "github.com/docker/docker/registry"
27+ "github.com/docker/libtrust"
2728 "github.com/opencontainers/go-digest"
2829 "github.com/pkg/errors"
2930 "github.com/sirupsen/logrus"
@@ -187,7 +188,7 @@ func (p *pusher) pushTag(ctx context.Context, ref reference.NamedTagged, id dige
187188
188189 putOptions := []distribution.ManifestServiceOption {distribution .WithTag (ref .Tag ())}
189190 if _ , err = manSvc .Put (ctx , manifest , putOptions ... ); err != nil {
190- if runtime .GOOS == "windows" || p .config .TrustKey == nil || p . config . RequireSchema2 {
191+ if runtime .GOOS == "windows" || p .config .RequireSchema2 {
191192 logrus .Warnf ("failed to upload schema2 manifest: %v" , err )
192193 return err
193194 }
@@ -211,7 +212,11 @@ func (p *pusher) pushTag(ctx context.Context, ref reference.NamedTagged, id dige
211212 if err != nil {
212213 return err
213214 }
214- builder = schema1 .NewConfigManifestBuilder (p .repo .Blobs (ctx ), p .config .TrustKey , manifestRef , imgConfig )
215+ pk , err := libtrust .GenerateECP256PrivateKey ()
216+ if err != nil {
217+ return errors .Wrap (err , "unexpected error generating private key" )
218+ }
219+ builder = schema1 .NewConfigManifestBuilder (p .repo .Blobs (ctx ), pk , manifestRef , imgConfig )
215220 manifest , err = manifestFromBuilder (ctx , builder , descriptors )
216221 if err != nil {
217222 return err
0 commit comments