我正在尝试按照使用multi-stage builds精简Docker文件的说明进行操作。特别是,我尝试使用以下Dockerfile将构建的可执行文件从构建器映像复制到alpine:latest
:
FROM debian:stable-slim AS builder
RUN apt-get update && \
apt-get install -y --no-install-recommends fp-compiler fp-units-fcl fp-units-net libc6-dev
COPY src /whatwg/wattsi/src
RUN /whatwg/wattsi/src/build.sh
FROM alpine:latest
COPY --from=builder /whatwg/wattsi/bin /whatwg/wattsi/bin
ENTRYPOINT ["/whatwg/wattsi/bin/wattsi"]
但是,当我尝试使用docker run
运行生成的docker映像时,出现错误
standard_init_linux.go:211: exec user process caused "no such file or directory"
发生了什么,我该如何解决?
此问题已经出现多次,并且此错误似乎有很多可能的原因。一些是missing or wrong shebang instructions in any bash scripts或Windows line endings in files copied to the volume。但是,就我而言,它是出于不同的原因。