gpt4 book ai didi

Docker 构建 : the command returned a non-zero code: 141

转载 作者:行者123 更新时间:2023-12-04 19:26:08 27 4
gpt4 key购买 nike

我的 docker 构建因错误而中断:

The command '/bin/bash -o pipefail -c yes "" | make -C build modules_prepare' returned a non-zero code: 141
根据输出似乎没有任何错误:
Sending build context to Docker daemon  4.608kB
Step 1/22 : FROM nvcr.io/nvidia/deepstream:6.0-triton
---> 6e629647efba
Step 2/22 : ENV DEBIAN_FRONTEND noninteractive
---> Using cache
---> 14c68281630c
Step 3/22 : ENV VERSION="2.83.18%2Brev1.dev"
---> Using cache
---> 335b81c074f5
Step 4/22 : ENV BALENA_MACHINE_NAME="genericx86-64-ext"
---> Using cache
---> c7edbb00963b
Step 5/22 : ENV YOCTO_VERSION=5.10.43
---> Using cache
---> 249c826b797d
Step 6/22 : ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard
---> Using cache
---> e461e8e8d344
Step 7/22 : ENV NVIDIA_DRIVER_VERSION=470.86
---> Using cache
---> 3f03b3e9cc5d
Step 8/22 : ENV NVIDIA_DRIVER=NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}
---> Using cache
---> 6ffdcc3b3f3b
Step 9/22 : RUN apt install -y git wget unzip build-essential libelf-dev bc libssl-dev bison flex software-properties-common
---> Using cache
---> 6fd098b57193
Step 10/22 : RUN mkdir -p /usr/src/kernel_source
---> Using cache
---> e78af78d2155
Step 11/22 : WORKDIR /usr/src/kernel_source
---> Using cache
---> 92736ef43a17
Step 12/22 : SHELL ["/bin/bash", "-o", "pipefail", "-c"]
---> Using cache
---> 5a2bb2b594f1
Step 13/22 : RUN curl -fsSL "https://files.balena-cloud.com/images/${BALENA_MACHINE_NAME}/${VERSION}/kernel_source.tar.gz" | tar xz --strip-components=2
---> Using cache
---> aa9144ca09d0
Step 14/22 : RUN yes "" | make -C build modules_prepare
---> Running in 8bc96b153e68
make: Entering directory '/usr/src/kernel_source/build'
SYNC include/config/auto.conf.cmd
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/confdata.o
HOSTCC scripts/kconfig/expr.o
LEX scripts/kconfig/lexer.lex.c
YACC scripts/kconfig/parser.tab.[ch]
HOSTCC scripts/kconfig/lexer.lex.o
HOSTCC scripts/kconfig/parser.tab.o
HOSTCC scripts/kconfig/preprocess.o
HOSTCC scripts/kconfig/symbol.o
HOSTCC scripts/kconfig/util.o
HOSTLD scripts/kconfig/conf
*
* Restart config...
*
*
* BPF based packet filtering framework (BPFILTER)
*
BPF based packet filtering framework (BPFILTER) (BPFILTER) [Y/n/?] y
bpfilter kernel module with user mode helper (BPFILTER_UMH) [M/n/y/?] (NEW)
*
* Sample kernel code
*
Sample kernel code (SAMPLES) [Y/n/?] y
auxdisplay sample (SAMPLE_AUXDISPLAY) [N/y/?] (NEW)
Build trace_events examples -- loadable modules only (SAMPLE_TRACE_EVENTS) [N/m/?] n
Build trace_printk module - tests various trace_printk formats (SAMPLE_TRACE_PRINTK) [M/n/?] m
Build register_ftrace_direct() example (SAMPLE_FTRACE_DIRECT) [N/m/?] n
Build sample module for kernel access to Ftrace instancess (SAMPLE_TRACE_ARRAY) [N/m/?] n
Build kobject examples (SAMPLE_KOBJECT) [N/m/y/?] n
Build kprobes examples -- loadable modules only (SAMPLE_KPROBES) [N/m/?] n
Build kernel hardware breakpoint examples -- loadable module only (SAMPLE_HW_BREAKPOINT) [N/m/?] n
Build kfifo examples -- loadable modules only (SAMPLE_KFIFO) [N/m/?] n
Build kdb command example -- loadable modules only (SAMPLE_KDB) [N/m/?] n
Build rpmsg client sample -- loadable modules only (SAMPLE_RPMSG_CLIENT) [N/m/?] n
Build configfs patching sample -- loadable modules only (SAMPLE_CONFIGFS) [N/m/?] n
Build VFIO mtty example mediated device sample code -- loadable modules only (SAMPLE_VFIO_MDEV_MTTY) [N/m/?] n
Build VFIO mdpy example mediated device sample code -- loadable modules only (SAMPLE_VFIO_MDEV_MDPY) [N/m/?] n
Build VFIO mdpy example guest fbdev driver -- loadable module only (SAMPLE_VFIO_MDEV_MDPY_FB) [N/m/?] n
Build VFIO mdpy example mediated device sample code -- loadable modules only (SAMPLE_VFIO_MDEV_MBOCHS) [N/m/?] n
watchdog sample (SAMPLE_WATCHDOG) [N/y/?] (NEW)
SYSTBL arch/x86/include/generated/asm/syscalls_32.h
SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h
SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h
SYSTBL arch/x86/include/generated/asm/syscalls_64.h
HYPERCALLS arch/x86/include/generated/asm/xen-hypercalls.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_64.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_x32.h
HOSTCC arch/x86/tools/relocs_32.o
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
HOSTLD arch/x86/tools/relocs
HOSTCC scripts/selinux/genheaders/genheaders
HOSTCC scripts/selinux/mdp/mdp
HOSTCC scripts/bin2c
HOSTCC scripts/kallsyms
HOSTCC scripts/recordmcount
HOSTCC scripts/sorttable
HOSTCC scripts/asn1_compiler
HOSTCC scripts/sign-file
HOSTCC scripts/extract-cert
HOSTCC scripts/insert-sys-cert
WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h
WRAP arch/x86/include/generated/uapi/asm/errno.h
WRAP arch/x86/include/generated/uapi/asm/fcntl.h
WRAP arch/x86/include/generated/uapi/asm/ioctl.h
WRAP arch/x86/include/generated/uapi/asm/ioctls.h
WRAP arch/x86/include/generated/uapi/asm/ipcbuf.h
WRAP arch/x86/include/generated/uapi/asm/param.h
WRAP arch/x86/include/generated/uapi/asm/poll.h
WRAP arch/x86/include/generated/uapi/asm/resource.h
WRAP arch/x86/include/generated/uapi/asm/socket.h
WRAP arch/x86/include/generated/uapi/asm/sockios.h
WRAP arch/x86/include/generated/uapi/asm/termbits.h
WRAP arch/x86/include/generated/uapi/asm/termios.h
WRAP arch/x86/include/generated/uapi/asm/types.h
WRAP arch/x86/include/generated/asm/early_ioremap.h
WRAP arch/x86/include/generated/asm/export.h
WRAP arch/x86/include/generated/asm/mcs_spinlock.h
WRAP arch/x86/include/generated/asm/irq_regs.h
WRAP arch/x86/include/generated/asm/local64.h
WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
WRAP arch/x86/include/generated/asm/mmiowb.h
WRAP arch/x86/include/generated/asm/module.lds.h
WRAP arch/x86/include/generated/asm/rwonce.h
CC scripts/mod/empty.o
HOSTCC scripts/mod/mk_elfconfig
MKELF scripts/mod/elfconfig.h
HOSTCC scripts/mod/modpost.o
CC scripts/mod/devicetable-offsets.s
UPD scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTCC scripts/mod/sumversion.o
HOSTLD scripts/mod/modpost
scripts/Makefile.build:414: warning: overriding recipe for target 'modules.order'
Makefile:1421: warning: ignoring old recipe for target 'modules.order'
DESCEND objtool
HOSTCC /usr/src/kernel_source/build/tools/objtool/fixdep.o
HOSTLD /usr/src/kernel_source/build/tools/objtool/fixdep-in.o
LINK /usr/src/kernel_source/build/tools/objtool/fixdep
CC /usr/src/kernel_source/build/tools/objtool/exec-cmd.o
CC /usr/src/kernel_source/build/tools/objtool/help.o
CC /usr/src/kernel_source/build/tools/objtool/pager.o
CC /usr/src/kernel_source/build/tools/objtool/parse-options.o
CC /usr/src/kernel_source/build/tools/objtool/run-command.o
CC /usr/src/kernel_source/build/tools/objtool/sigchain.o
CC /usr/src/kernel_source/build/tools/objtool/subcmd-config.o
LD /usr/src/kernel_source/build/tools/objtool/libsubcmd-in.o
AR /usr/src/kernel_source/build/tools/objtool/libsubcmd.a
CC /usr/src/kernel_source/build/tools/objtool/arch/x86/special.o
MKDIR /usr/src/kernel_source/build/tools/objtool/arch/x86/lib/
GEN /usr/src/kernel_source/build/tools/objtool/arch/x86/lib/inat-tables.c
CC /usr/src/kernel_source/build/tools/objtool/arch/x86/decode.o
LD /usr/src/kernel_source/build/tools/objtool/arch/x86/objtool-in.o
CC /usr/src/kernel_source/build/tools/objtool/weak.o
CC /usr/src/kernel_source/build/tools/objtool/check.o
CC /usr/src/kernel_source/build/tools/objtool/special.o
CC /usr/src/kernel_source/build/tools/objtool/orc_gen.o
CC /usr/src/kernel_source/build/tools/objtool/orc_dump.o
CC /usr/src/kernel_source/build/tools/objtool/builtin-check.o
CC /usr/src/kernel_source/build/tools/objtool/builtin-orc.o
CC /usr/src/kernel_source/build/tools/objtool/elf.o
CC /usr/src/kernel_source/build/tools/objtool/objtool.o
CC /usr/src/kernel_source/build/tools/objtool/libstring.o
CC /usr/src/kernel_source/build/tools/objtool/libctype.o
CC /usr/src/kernel_source/build/tools/objtool/str_error_r.o
CC /usr/src/kernel_source/build/tools/objtool/librbtree.o
LD /usr/src/kernel_source/build/tools/objtool/objtool-in.o
LINK /usr/src/kernel_source/build/tools/objtool/objtool
LDS scripts/module.lds
make: Leaving directory '/usr/src/kernel_source/build'
The command '/bin/bash -o pipefail -c yes "" | make -C build modules_prepare' returned a non-zero code: 141
如何重现该问题:
FROM nvcr.io/nvidia/deepstream:6.0-triton

ENV DEBIAN_FRONTEND noninteractive

# Set some variables to download the proper header modules
ENV VERSION="2.83.18%2Brev1.dev"
ENV BALENA_MACHINE_NAME="genericx86-64-ext"

# Set variables for the Yocto version of the OS
ENV YOCTO_VERSION=5.10.43
ENV YOCTO_KERNEL=${YOCTO_VERSION}-yocto-standard

# Set variables to download proper NVIDIA driver
ENV NVIDIA_DRIVER_VERSION=470.86
ENV NVIDIA_DRIVER=NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_VERSION}

# Install some prerequisites
RUN apt install -y git wget unzip build-essential libelf-dev bc libssl-dev bison flex software-properties-common

# Workdir
RUN mkdir -p /usr/src/kernel_source
WORKDIR /usr/src/kernel_source

# Causes a pipeline to produce a failure return code if any command errors.
# Normally, pipelines only return a failure if the last command errors.
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Download the kernel source then prepare kernel source to build a module.
RUN curl -fsSL "https://files.balena-cloud.com/images/${BALENA_MACHINE_NAME}/${VERSION}/kernel_source.tar.gz" \
| tar xz --strip-components=2
RUN yes "" | make -C build modules_prepare
我怎样才能解决这个问题?

最佳答案

您不能使用 yes-o pipefail . yes程序永远写入它的标准输出,直到有人关闭管道,关闭管道的行为是失败的:

$ bash -c -o pipefail -c 'yes "" | head -n1'

yes: standard output: Broken pipe
退出代码 141 是信号 13 (141 - 128 = 13),信号 13 是 SIGPIPE,这是管道损坏的错误。
由于您没有提供有关您为什么这样做的任何详细信息,我们无法提供帮助,但是通过标准输入将文本发送到 make 调用的程序是非常奇怪/不寻常的。
另一个可行的选择是对调用 shell 隐藏失败;就像是:
(yes "" 2>/dev/null || true) | make -C build modules_prepare

关于Docker 构建 : the command returned a non-zero code: 141,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70852143/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com