Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

967
Views
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?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

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

over 4 years ago · Santiago Trujillo Report

0

For this particular example, you should not have Dockerfile in /home/shim.

In the general case of a socket (*.sock) file in your project, you can add *.sock to your .dockerignore file.

over 4 years ago · Santiago Trujillo Report

0

Hi I also face the same issues and got to know the reason from this Quection. My Dockerfile is restarting MySQL in a step and it creates a file called mysqld.sock which is a giving above error while building image. If that is your case then you can add .sock file in repo itself and then use it from there.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!