![](/img/trans.png)
[英]Docker buildx with node app on Apple M1 Silicon - standard_init_linux.go:211: exec user process caused "exec format error
[英]standard_init_linux.go:219: exec user process caused: no such file or directory - docker problem
I have a problem with the docker, when running the command docker-compose up -d --build
3 containers app, database, api
are created within the application innovation
, however when accessing the docker terminal in the api container I get this error`` this是我的 docker-compose.yaml:
version: "3"
services:
api:
build: ./api
entrypoint: ./.docker/entrypoint.sh
container_name: quimiweb-innovation-api
env_file: .env
environment:
DATABASE_CLIENT: ${DATABASE_CLIENT}
DATABASE_NAME: ${DATABASE_NAME}
DATABASE_HOST: ${DATABASE_HOST}
DATABASE_PORT: ${DATABASE_PORT}
DATABASE_USERNAME: ${DATABASE_USERNAME}
DATABASE_PASSWORD: ${DATABASE_PASSWORD}
FRONTEND_URL: ${FRONTEND_URL}
ports:
- "1337:1337"
volumes:
- ./api/:/home/node/api
networks:
- app-network
database:
image: mongo
container_name: quimiweb-innovation-database
env_file: .env
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
networks:
- app-network
volumes:
- .database/:/data/db
ports:
- "27017:27017"
app:
build: ./app/
entrypoint: ./.docker/entrypoint.sh
container_name: quimiweb-innovation-app
env_file: .env
environment:
SKIP_PREFLIGHT_CHECK: ${SKIP_PREFLIGHT_CHECK}
ports:
- 3001:3001
volumes:
- ./app/:/home/node/app
networks:
app-network:
driver: bridge
volumes:
app-volume:
我来自 api 的 entrypoint.sh:
#!/bin/bash
yarn
yarn develop
启动基于64-bit x86
代理但在64-bit Arm
容器主机上运行的映像时,也可能出现此错误。
就我而言,我通过将entrypoint.sh
文件的行尾从CRLF
更改为LF
来解决它
编辑
在右侧底部面板上的 Notepad++ 中,右键单击区域Windows (CR LF)
和 select UNIX (LF)
这应该替换所有CRLFs
LFs
。
对我来说,行尾已经是 LF,我删除了所有图像并重建了它们,但在构建之前,我发现我错过了 shebang -
#!/bin/bash
我刚刚添加并重建了容器并发现它可以正常工作。
同样的问题,通过更改行尾作为 Thyi 解决。 还必须在更改生效之前重建映像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.