Docker run出错standard_init_linux.go:211处理
出错场景
最近在学习Rust基础知识,工作中也有在使用Docker部署环境,在学习过程中想把Rust编写的Hello World部署到Docker中运行。参考了Docker的官网,制作了Docker镜像,并执行Docker run之后,提示错误,standard_init_linux.go:211: exec user process caused “no such file or directory”,搜索无果,后对比官方示例,终于解决掉了,特此记录下来,备忘。
$ docker run hello_rust
standard_init_linux.go:211: exec user process caused "no such file or directory"
$
详细步骤
1.创建hello_rust项目并编译
按照如下步骤创建并编译hello_rust项目,在target下找到hello_rust可执行文件,具体rust相关的工具可参考rust官网的文档,具体的编码内容从略。
执行./hello_rust后可打印出Hello, world!
$ cd rust-demo
$ $ cargo new hello_rust
Created binary (application) `hello_rust` package
$ cd hello_rust
$ cargo build --release
Compiling hello_rust v0.1.0 (/home/zxl/rust-demo/hello_rust)
Finished release [optimized] target(s) in 11.16s
$ cd target/release/
$ ls
build deps examples hello_rust hello_rust.d incremental
$ ./hello_rust
Hello, world!
$