llb: don't fill platform on static sources
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>docker-18.09
parent
98f1604134
commit
1456a3f165
|
@ -65,6 +65,11 @@ func (s *SourceOp) Marshal(constraints *Constraints) (digest.Digest, []byte, *pb
|
|||
proto.Op = &pb.Op_Source{
|
||||
Source: &pb.SourceOp{Identifier: s.id, Attrs: s.attrs},
|
||||
}
|
||||
|
||||
if !platformSpecificSource(s.id) {
|
||||
proto.Platform = nil
|
||||
}
|
||||
|
||||
dt, err := proto.Marshal()
|
||||
if err != nil {
|
||||
return "", nil, nil, err
|
||||
|
@ -361,3 +366,7 @@ func Chown(uid, gid int) HTTPOption {
|
|||
hi.GID = gid
|
||||
})
|
||||
}
|
||||
|
||||
func platformSpecificSource(id string) bool {
|
||||
return strings.HasPrefix(id, "docker-image://")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue