【发布时间】:2017-02-02 09:21:53
【问题描述】:
我有一个具有以下结构的 Cargo 项目:
experiment
|
|- Dockerfile
|- Cargo.toml
|- src/
|-- main.rs
我的 Dockerfile 的内容是 (source):
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
我已经成功构建了映像,但是当我尝试在本地计算机上运行它时,出现以下错误:
docker run -i -d -p 8080:80 --name rust_hello_world menawi/rust_hello_world
517a8772100cbd6fd388df1f3767175113ce2dbad93d144976b59d63d4809146
docker ps -a
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
error: could not find `Cargo.toml` in `/rust/app` or any parent directory
为什么会出现此错误?有什么方法可以查看哪些文件被复制到 /rust/app 文件夹中?
【问题讨论】:
标签: docker rust-cargo