2016-09-24 5 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であるよりも、bash

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

ように CMDをオーバーライドして、フォルダ内のファイルの一覧を印刷することができ