Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker build error, archive/tar: sockets not supported

I'm new to Docker and trying to build an image. I succeeded in doing that with the Docker commit command, but when I'm trying to do it with Dockerfile I get this errors:

shim@shim-Inspiron-5570:~$ sudo docker build -t shim/debian .
[sudo] password for shim: 
ERRO[0014] Can't add file /home/shim/.ServiceHub/bc1be858c1/116f2fb4b7 to tar: archive/tar: sockets not supported 
ERRO[0014] Can't add file /home/shim/.ServiceHub/bc1be858c1/11a6628921 to tar: archive/tar: sockets not supported 
ERRO[0014] Can't add file /home/shim/.ServiceHub/bc1be858c1/2cb20241cd to tar: archive/tar: sockets not supported 
ERRO[0014] Can't add file /home/shim/.ServiceHub/bc1be858c1/4964606154 to tar: archive/tar: sockets not supported 
ERRO[0014] Can't add file /home/shim/.ServiceHub/bc1be858c1/bc1be858c1 to tar: archive/tar: sockets not supported 
^Cnding build context to Docker daemon  1.725GB

The Docker file looks like this:

FROM debian:shim
RUN apt-get update
RUN apt-get install -y git
RUN apt-get install -y vim

I'm using Ubuntu DeskTop 18.04 Can some one help me with it?

like image 746
Shimon Wiener Avatar asked Feb 24 '26 16:02

Shimon Wiener


1 Answers

It looks like your Dockerfile is probably in /home/shim/?

When you do docker build ., docker will tar up the contents of the current directory and send it to the docker daemon. It looks like some of the files in /home/shim/.ServiceHub are actually sockets, so this operation fails.

Best practice is to have the Dockerfile in its own, isolated, directory to avoid stuff like this.

Also, I suggest having a read through dockerfile_best-practices, in particular the bit about RUN & apt-get

like image 96
SiHa Avatar answered Feb 26 '26 06:02

SiHa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!