gpt4 book ai didi

linux - Docker:standard_init_linux.go:211:exec 用户进程导致 "exec format error"

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

我使用 buildx 命令创建了一个 docker multiarch 镜像。

sudo docker buildx build -f build/Dockerfile --platform linux/arm/v7,linux/arm64,linux/amd64 -t uditgaurav/chaos-operator:v3 . --push
构建/Dockerfile:
FROM golang:1.13 

ENV GO111MODULE=on \
CGO_ENABLED=1

ENV OPERATOR=/usr/local/bin/chaos-operator \
USER_UID=1001 \
USER_NAME=chaos-operator

# install operator binary
COPY build/_output/bin/chaos-operator ${OPERATOR}

COPY build/bin /usr/local/bin

RUN /usr/local/bin/user_setup

RUN export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) && \
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) && \
GOARM=$(echo ${TARGETPLATFORM} | cut -d / -f3 | cut -c2-)

ENTRYPOINT ["/usr/local/bin/entrypoint"]

USER ${USER_UID}
dockerhub图像带有差异 arch :
但是当我在 arm 集群中运行它时,它显示错误:
standard_init_linux.go:211: exec user process caused "exec format error"
ARM 集群上的 Docker 版本
Client:
Version: 19.03.6
API version: 1.40
Go version: go1.12.17
Git commit: 369ce74a3c
Built: Fri Feb 28 23:47:53 2020
OS/Arch: linux/arm64
Experimental: false

Server:
Engine:
Version: 19.03.6
API version: 1.40 (minimum version 1.12)
Go version: go1.12.17
Git commit: 369ce74a3c
Built: Wed Feb 19 01:06:16 2020
OS/Arch: linux/arm64
Experimental: false
containerd:
Version: 1.3.3-0ubuntu1~18.04.2
GitCommit:
runc:
Version: spec: 1.0.1-dev
GitCommit:
docker-init:
Version: 0.18.0
GitCommit:
有人可以帮忙吗?

最佳答案

Docker multiarch 构建不是问题。问题是/usr/local/bin/chaos-operator是一个 linux/amd64 二进制文件,您正试图在 linux/arm64 上运行它。

关于linux - Docker:standard_init_linux.go:211:exec 用户进程导致 "exec format error",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63693708/

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