I'm not sure if this is the right place to ask but I am running a docker build command which is building an image on a mounted Volume. During the process I get this weird error

Can't add file /mnt/Volumes/file/on/volume to tar: archive/tar: sockets not supported

What does this mean?

  • 1
    Looks like /mnt/Volumes/file/on/volume is a UNIX domain socket, you can verify this with the output of file /mnt/Volumes/file/on/volume
    – Torin
    Apr 13, 2018 at 20:16

2 Answers 2


This is what worked for me. I tried to do docker commit and I got the message

  ERRO[2018-10-06T20:54:22.894911981-05:00] Can't add file /var/lib/docker/overlay2/161e218868241d450115fafcadc20b52ad2c81bf2e6b83897d3dfb7081eea34d/diff/tmp/ssh-OOMPJg4ESVMk/agent.165 to tar: archive/tar: sockets not supported

I attached to the container again and deleted /tmp/ssh-OOMPJg4ESVMk/ then it committed just fine.

What is happening is something created a socket. For example the command eval $(ssh-agent -s) creates a socket and I didn't realize it.

Delete the sock file and it commits.

  • I noticed that even with the error it still commits. Oct 7, 2018 at 2:31

If you really like to archive this file, I recommend you to use the dump extensions from star


star -C /mnt -c -dump Volumes > /tmp/file.tar

to archive all file types. If you like to be more complete with your backup, add:




With -dump, star uses the exustar format that has been designed for accurate incremental backups.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .