2016-09-24 382 views
0

我有以下結構的貨物項目:泊塢窗:Cargo.toml沒有找到

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 logs rust_hello_world

error: could not find `Cargo.toml` in `/rust/app` or any parent directory 

爲什麼我得到這個錯誤?有沒有辦法可以看到哪些文件被複制到/ rust/app文件夾中?

回答

0

您可以運行容器內,用bash

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

比你在容器的bash的覆蓋CMD,你可以打印文件夾中的文件列表