Docker run 出错standard_init_linux.go:211问题处理

Docker run出错standard_init_linux.go:211处理出错场景;问题及解决的详细步骤:1.创建hello_rust项目并编译2.Docker部署hello_rust;编写Dockerfile;build镜像;运行镜像;运行自定义镜像[hello_rust];运行官方镜像[hello_world]问题分析总结
摘要由CSDN通过智能技术生成

出错场景

最近在学习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!
$ 

2.Docker部署hello_rust

2.1 创建镜像</

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值