我正在修补使用的Docker:
COPY ./entrypoint.sh /usr/src/app/entrypoint.sh
RUN chmod +x /usr/src/app/entrypoint.sh
奇怪的是,我收到错误消息,说“没有这样的文件或目录”,但是 它在那里。
当我致电docker-compose -f docker-compose-dev.yml up -d --build
时
命令我得到以下输出:
Successfully built 36461c09191a
Successfully tagged testdriven-app_users:latest
testdriven-app_users-db_1 is up-to-date
Recreating testdriven-app_users_1 ... error
ERROR: for testdriven-app_users_1 Cannot start service users: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/usr/src/app/entrypoint.sh\": stat /usr/src/app/entrypoint.sh: no such file or directory": unknown
ERROR: for users Cannot start service users: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"/usr/src/app/entrypoint.sh\": stat /usr/src/app/entrypoint.sh: no such file or directory": unknown
ERROR: Encountered errors while bringing up the project.
我该怎么解决?
答案 0 :(得分:0)
由于尝试将文件复制到文件系统中不存在的文件夹中而引发该错误,该文件夹为:entrypoint.sh
您必须将COPY
命令更改为:
COPY ./entrypoint.sh /usr/src/app
您的目标路径是folder
,因此它不能包含文件名。