首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >码头:找不到Cargo.toml

码头:找不到Cargo.toml
EN

Stack Overflow用户
提问于 2016-09-24 17:20:22
回答 1查看 859关注 0票数 0

我有一个货运项目,其结构如下:

代码语言:javascript
复制
experiment
|
|- Dockerfile
|- Cargo.toml
|- src/
|-- main.rs

我的Dockerfile的内容是(来源):

代码语言:javascript
复制
FROM scorpil/rust:1.10

RUN mkdir -p /rust/app
WORKDIR /rust/app

ONBUILD COPY . /rust/app
OBUILD CMD ls -a /source
ONBUILD RUN cargo build --release

CMD cargo run --release

我已经成功地构建了映像,但是当我试图在本地机器上运行它时,我会得到以下错误:

船坞运行-i -d -p 8080:80 --名为rust_hello_world menawi/rust_hello_world _hello_world

代码语言:javascript
复制
517a8772100cbd6fd388df1f3767175113ce2dbad93d144976b59d63d4809146

码头ps -a

代码语言:javascript
复制
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                        PORTS               NAMES
517a8772100c        menawi/rust_hello_world   "/bin/sh -c 'cargo ru"   17 seconds ago      Exited (101) 11 seconds ago                       rust_hello_world

docker日志rust_hello_world

代码语言:javascript
复制
error: could not find `Cargo.toml` in `/rust/app` or any parent directory

为什么我会有这个错误?有什么方法可以看到哪些文件被复制到/锈迹/app文件夹中?

EN

回答 1

Stack Overflow用户

发布于 2016-09-24 19:00:17

您可以运行容器并使用类似于CMDbash覆盖bash

docker run -i -t -p 8080:80 --name rust_hello_world menawi/rust_hello_world bash

而不是在容器的bash中,并且可以在文件夹中打印文件列表。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39679001

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档