Ignore sockets when creating a tar stream of a layer
The go-tar implementation which is used cannot handle sockets. There's no good reason to preserve a socket, they are basically useless without the process which made them. Signed-off-by: Ian Campbell <ian.campbell@docker.com>
This commit is contained in:
parent
9304193b8c
commit
2ec3382d2d
@ -465,7 +465,10 @@ func (cw *changeWriter) HandleChange(k fs.ChangeKind, p string, f os.FileInfo, e
|
||||
source = filepath.Join(cw.source, p)
|
||||
)
|
||||
|
||||
if f.Mode()&os.ModeSymlink != 0 {
|
||||
switch {
|
||||
case f.Mode()&os.ModeSocket != 0:
|
||||
return nil // ignore sockets
|
||||
case f.Mode()&os.ModeSymlink != 0:
|
||||
if link, err = os.Readlink(source); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user