使用docker-compose构建时出现错误:Invalid signal: SIGQUIT

29次阅读
没有评论

问题描述

在使用docker-compose构建时遇到了一个错误:Invalid signal: SIGQUIT。他在构建过程中使用了以下命令:

docker-compose up

构建过程中出现了以下错误信息:

Building app
Step 1/7 : FROM php:7.4-fpm-alpine
—> 5ae58b49885c
Step 2/7 : RUN apk add --no-cache autoconf curl dpkg-dev dpkg freetype-dev file g++ gcc giticu-dev jpeg-dev libc-dev libmcrypt-dev libpng-dev libjpeg-turbo-dev libxml2-dev libzip-dev make mariadb-dev postgresql-dev pkgconf php7-dev re2c rsync unzip wget zlib-dev
ERROR: Service ‘app’ failed to build: Invalid signal: SIGQUIT

用户尝试了以下命令来运行容器:

docker run -ti 5ae58b49885c apk add --no-cache autoconf curl dpkg-dev dpkg freetype-dev file g++ gcc git icu-dev jpeg-dev libc-dev libmcrypt-dev libpng-dev libjpeg-turbo-dev libxml2-dev libzip-dev make mariadb-dev postgresql-dev pkgconf php7-dev re2c rsync unzip wget zlib-dev

这个命令似乎可以正常运行,但是在最后出现了以下错误信息:

[...]OK: 392 MiB in 105 packages
time="2020-05-23T11:54:06+05:00" level=error msg="Error waiting for container: failed to shutdown container: container 4e49e4bb8234f213ed580978bc3a4f4cacff549f91affcf82783a2703f341ddb encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110): subsequent terminate failed container 4e49e4bb8234f213ed580978bc3a4f4cacff549f91affcf82783a2703f341ddb encountered an error during hcsshim::System::waitBackground: failure in a Windows system call: The virtual machine or container with the specified identifier is not running. (0xc0370110)"

用户的docker版本是19.03.8,操作系统是Windows。
用户尝试切换容器,但是问题仍然存在。用户想知道如何解决这个问题或如何进行调试。

解决方案

请注意以下操作注意版本差异及修改前做好备份。

方案1

根据用户提供的信息,这个问题可能是由于docker版本不兼容或存在bug导致的。尝试升级docker版本到最新的稳定版本,看看是否能解决这个问题。如果问题仍然存在,请尝试以下解决方案。

方案2

根据用户提供的错误信息,这个问题可能与Windows系统的某些限制有关。尝试以下步骤来解决这个问题:
1. 确保你的Windows系统已经安装了最新的更新和补丁。
2. 尝试重启你的计算机,然后再次运行docker-compose命令。
3. 如果问题仍然存在,尝试使用管理员权限运行docker-compose命令。右键点击命令提示符或PowerShell,并选择“以管理员身份运行”。
4. 如果问题仍然存在,尝试在docker-compose.yml文件中添加--no-cache选项。例如:

version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: your_image_name
    cache_from:
      - your_image_name
    cache: false
  1. 如果问题仍然存在,尝试在docker-compose.yml文件中添加--force-recreate选项。例如:
version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: your_image_name
    command: --force-recreate
  1. 如果问题仍然存在,尝试在docker-compose.yml文件中添加--build选项。例如:
version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: your_image_name
    command: --build
  1. 如果问题仍然存在,尝试在docker-compose.yml文件中添加--no-deps选项。例如:
version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: your_image_name
    command: --no-deps
  1. 如果问题仍然存在,尝试在docker-compose.yml文件中添加--abort-on-container-exit选项。例如:
version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: your_image_name
    command: --abort-on-container-exit

如果以上解决方案都无法解决问题,请尝试在docker-compose.yml文件中添加其他选项,或者尝试使用其他构建工具来构建你的应用程序。

方案3

根据用户提供的最佳回答,尝试升级docker-compose到最新的版本(2.3.1.0),看看是否能解决这个问题。你可以使用以下命令来升级docker-compose:

pip install --upgrade docker-compose

请注意,这个解决方案可能不适用于所有情况,具体取决于你的环境和配置。
以上是几种可能的解决方案,希望能帮助你解决这个问题。如果问题仍然存在,请尝试在相关的社区或论坛上寻求帮助,以获取更多的支持和建议。

正文完