Skip to content

Commit

Permalink
Ignore sockets when creating a tar stream of a layer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ijc authored and dmcgowan committed Mar 22, 2018
1 parent c0f92dd commit 6f0d280
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion archive/tar.go
Expand Up @@ -345,7 +345,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
}
Expand Down

0 comments on commit 6f0d280

Please sign in to comment.