Soy nuevo en Docker y trato de construir una imagen. Logré hacerlo con el comando de confirmación de Docker, pero cuando intento hacerlo con Dockerfile, aparece este error:
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.725GBEl archivo Docker se ve así:
FROM debian:shim RUN apt-get update RUN apt-get install -y git RUN apt-get install -y vimEstoy usando Ubuntu DeskTop 18.04 ¿Puede alguien ayudarme con eso?
Parece que su Dockerfile probablemente esté en /home/shim/ ?
Cuando haces docker build . , la ventana acoplable cargará el contenido del directorio actual y lo enviará al demonio de la ventana acoplable. Parece que algunos de los archivos en /home/shim/.ServiceHub son en realidad sockets, por lo que esta operación falla.
La mejor práctica es tener el Dockerfile en su propio directorio aislado para evitar cosas como esta.
Además, sugiero leer dockerfile_best-practices , en particular la parte sobre RUN & apt-get
Para este ejemplo en particular, no debería tener Dockerfile en /home/shim .
En el caso general de un archivo de socket ( *.sock ) en su proyecto, puede agregar *.sock a su archivo .dockerignore .
Hola, también me enfrento a los mismos problemas y conocí el motivo de esta pregunta. Mi Dockerfile está reiniciando MySQL en un paso y crea un archivo llamado mysqld.sock que es un error anterior al crear la imagen. Si ese es su caso, puede agregar el archivo .sock en el repositorio y luego usarlo desde allí.