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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With