-
Notifications
You must be signed in to change notification settings - Fork 961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker compose 怎么配置文件读取配置文件 #498
Comments
docker run --name dtm -p 36789:36789 -p 36790:36790 -v /var/go/src/server/app_server/build/dtm/config/config.yaml:/app/dtm/configs/config.yaml --entrypoint "-c=/app/dtm/configs/config.yaml" yedf/dtm:latest 直接报 docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "-c=/app/dtm/configs/config.yaml": stat -c=/app/dtm/configs/config.yaml: no such file or directory: unknown. |
你这个问题感觉是docker相关的问题,你可以问问熟悉docker的人帮你看看 |
你们有能正常用引入,并成功加载配置文件的例子吗 |
services:
dtm:
image: yedf/dtm
container_name: dtm
volumes:
- ./dtm/conf/config.yml:/etc/dtm/config.yml
ports:
- "36789:36789"
- "36790:36790"
entrypoint:
/app/dtm/dtm -c /etc/dtm/config.yml 这样可以成功 |
你的报错是没有找到配置文件,所以你看看自己是不是挂载文件出什么问题了 |
version: '3'
services:
dtm:
image: yedf/dtm
environment:
STORE_DRIVER: redis
STORE_HOST: 116.62.176.165
STORE_USER: ''
STORE_PASSWORD: 'maile~maile'
STORE_PORT: 6379
# MicroService: 'dtm'
working_dir: /var/dtm/config
entrypoint:
- -c /var/dtm/config/conf.yaml
volumes:
- ./config/:/var/dtm/config/
ports:
- '36789:36789'
- '36790:36790'
这样写直接报:ERROR: for dtm Cannot start service dtm: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "-c /var/dtm/config/conf.yaml": stat -c /var/dtm/config/conf.yaml: no such file or directory: unknown
错误没搞懂
The text was updated successfully, but these errors were encountered: