docker run --env-file /path/to/file.env 失败并显示“没有这样的文件或目录”

问题描述 投票:0回答:0

我正在尝试在 Debian 服务器上运行 docker 镜像。预制镜像已从 Docker Hub 中拉取。

cmd 行是(剥离到骨头):

sudo docker run -d -p 8190:433 --env-file /path/to/file.env my-image

/path/to/file.env 类似于 /var/lib/myapp/data/file.env

执行此操作会导致错误消息:

docker: open /path/to/file.env: no such file or directory

但是:文件存在(

ls /path/to/file.env
显示文件)。还尝试过 chown 到 root 和 chmod 777 但没有成功。还尝试将文件复制到 /tmp 并引用此文件。

docker file-not-found docker-run env-file
© www.soinside.com 2019 - 2024. All rights reserved.