alpine docker exec: "/bin/bash": stat /bin/bash: no such file or directory 解决方案

简介: alpine docker exec: "/bin/bash": stat /bin/bash: no such file or directory 解决方案docker exec -it 029e6df30836 /bin/bash exec: "/bin/bash": stat /bin/bash: no such file or directory我们一般可能会在容器启动后进入容器,常用的是docker attach 镜像id,但是启动镜像的时候如果没有带 参数 -it的话,attach进去后可能是日志界面,并不能执行命令。

alpine docker exec: "/bin/bash": stat /bin/bash: no such file or directory 解决方案

docker exec -it 029e6df30836 /bin/bash exec: "/bin/bash": stat /bin/bash: no such file or directory

我们一般可能会在容器启动后进入容器,常用的是docker attach 镜像id,但是启动镜像的时候如果没有带 参数 -it的话,attach进去后可能是日志界面,并不能执行命令。所以我们会用docker exec -it 镜像id /bin/bash/

平常的容器一般都可以执行/bin/bash,很是alpine没有,改成 docker exec -it 镜像id sh 就好了。

相关文章
|
2月前
|
移动开发 Shell Linux
百度搜索:蓝易云【Shell错误:/bin/bash^M: bad interpreter: No such file or directory】
将 `your_script.sh`替换为你的脚本文件名。运行此命令后,脚本文件的换行符将被转换为Linux格式,然后就可以在Linux系统上正常执行脚本了。
33 8
|
2月前
|
Java Shell Linux
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
解决 centos下执行sh文件报错“/bin/bash^M: 坏的解释器:没有那个文件或目录” 问题
|
17天前
|
存储 Kubernetes API
Docker拉取镜像或者kubectl出现的这个解决方案x509: certificate signed by unknown authority
Docker拉取镜像或者kubectl出现的这个解决方案x509: certificate signed by unknown authority
48 2
|
2月前
|
Shell Docker Python
Docker Exec 命令详解与实践指南
Docker Exec 命令详解与实践指南
119 1
|
2月前
|
NoSQL 开发工具 Redis
【docker专题_07】vim: command not found解决方案
【docker专题_07】vim: command not found解决方案
|
4月前
|
Unix Shell iOS开发
Shell错误:/bin/bash^M: bad interpreter: No such file or directory
Shell错误:/bin/bash^M: bad interpreter: No such file or directory
43 0
|
5月前
|
Ubuntu Shell
bash: No such file or directory
bash: No such file or directory
76 0
|
4月前
|
Linux Shell Windows
4:Bash shell命令-步入Linux的现代方法
4:Bash shell命令-步入Linux的现代方法
53 0
|
6月前
|
关系型数据库 MySQL Shell
【Linux命令】-bash: mysql: command not found
【Linux命令】-bash: mysql: command not found
56 0
|
8月前
|
Ubuntu 安全 Linux
不用安装虚拟机,直接在Windows上面运行Linux Bash Shell,嗯!真香!!!
不用安装虚拟机,直接在Windows上面运行Linux Bash Shell,嗯!真香!!!
152 0