我有一个货运项目,其结构如下:
experiment
|
|- Dockerfile
|- Cargo.toml
|- src/
|-- main.rs我的Dockerfile的内容是(来源):
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
517a8772100cbd6fd388df1f3767175113ce2dbad93d144976b59d63d4809146码头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_worlddocker日志rust_hello_world
error: could not find `Cargo.toml` in `/rust/app` or any parent directory为什么我会有这个错误?有什么方法可以看到哪些文件被复制到/锈迹/app文件夹中?
发布于 2016-09-24 19:00:17
您可以运行容器并使用类似于CMD的bash覆盖bash
docker run -i -t -p 8080:80 --name rust_hello_world menawi/rust_hello_world bash
而不是在容器的bash中,并且可以在文件夹中打印文件列表。
https://stackoverflow.com/questions/39679001
复制相似问题