golang 环境bash 以及shell

standard_init_linux.go:178: exec user process caused "no such file or directory"

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m0_37355951/article/details/80034010

 

 

概述:主要记录在使用docker遇到问题,综合网上找的。

1、Dockerfile构建问题

1.1、debconf: unable to initialize frontend: Dialog

原因是在使用apt-get安装依赖时,可能会有对话框,制作镜像时如果不选择会导致失败,解决办法也很简单 
在docker file中增加一句:

ENV DEBIAN_FRONTEND noninteractive

参考:详情

1.2、invoke-rc.d: policy-rc.d denied execution of start

在docker file 中添加一句:

RUN echo “#!/bin/sh\nexit 0” > /usr/sbin/policy-rc.d

参考: 
1、Docker 使用ubuntu容器时,安装包包错:invoke-rc.d: policy-rc.d denied execution of start 
2、How to solve “invoke-rc.d: policy-rc.d denied execution of start.” when building a container Ubuntu 14.04 and installing apache2?

2、启动容器阶段

2.1、standard_init_linux.go:178: exec user process caused “no such file or directory”

这个问题有点尴尬 
第一步如何看启动容器日志: 
$ sudo docker logs -f -t 容器名 
参考: 
Docker看容器启动日志 
解决方法: 
就是头部写错了 
把#!/bint/bash 改为 #!/bin/bash 需要重新构建build (刚开始以为#这是一行注释,其实这是采用哪种脚本来解释,还有一种是/bin/sh) 
以后还是不要惯性思维,你认为并不是你本来的样子 
参考: 
1、自定义容器启动脚本报错:exec user process caused “no such file or directory” 
2、Getting panic: spanic: standard_init_linux.go:178: exec user process caused no such file or directory” while running the docker imag

 
posted @   割肉机  阅读(1256)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
点击右上角即可分享
微信分享提示