OCI runtime exec failed: exec failed: unable to start container process: exec: "mongo": executable file not found in $PATH: unknown

本文涉及的产品
云数据库 MongoDB,通用型 2核4GB
简介: OCI runtime exec failed: exec failed: unable to start container process: exec: "mongo": executable file not found in $PATH: unknown

前言:

  今天按照以往在Docker安装MongoDB的方式安装,但是到最后使用mongo命令执行mongodb命令的时候一直执行不成功,最后还是按照官网的Issues解决了。

🚀回到顶部

创建并运行一个MongoDB容器:

docker run -itd --name mongo-test -p 27017:27017 mongo --auth

参数说明:

  • -itd:其中,i是交互式操作,t是一个终端,d指的是在后台运行。
  • --name mongo-test:容器名称
  • -p 27017:27017 :映射容器服务的 27017 端口到宿主机的 27017 端口。外部可以直接通过 宿主机 ip:27017 访问到 mongo 的服务。
  • --auth:需要密码才能访问容器服务。


image.png

image.png

解决无法正常执行mongo命令问题

进入容器:

docker exec -it  mongo-test mongo

image.png

异常原因:

OCI runtime exec failed: exec failed: unable to start container process: exec: "mongo": executable file not found in $PATH: unknown

官网解决方案:

https://github.com/docker-library/mongo/issues/558

mongo5.0以上的版本使用mongo来执行mongodb命令已经不支持了,你需要改用mongosh来替代mongo!

image.png

相关实践学习
MongoDB数据库入门
MongoDB数据库入门实验。
快速掌握 MongoDB 数据库
本课程主要讲解MongoDB数据库的基本知识,包括MongoDB数据库的安装、配置、服务的启动、数据的CRUD操作函数使用、MongoDB索引的使用(唯一索引、地理索引、过期索引、全文索引等)、MapReduce操作实现、用户管理、Java对MongoDB的操作支持(基于2.x驱动与3.x驱动的完全讲解)。 通过学习此课程,读者将具备MongoDB数据库的开发能力,并且能够使用MongoDB进行项目开发。   相关的阿里云产品:云数据库 MongoDB版 云数据库MongoDB版支持ReplicaSet和Sharding两种部署架构,具备安全审计,时间点备份等多项企业能力。在互联网、物联网、游戏、金融等领域被广泛采用。 云数据库MongoDB版(ApsaraDB for MongoDB)完全兼容MongoDB协议,基于飞天分布式系统和高可靠存储引擎,提供多节点高可用架构、弹性扩容、容灾、备份回滚、性能优化等解决方案。 产品详情: https://www.aliyun.com/product/mongodb
相关文章
|
3月前
|
NoSQL C语言
vscode出现 ERROR: Unable to start debugging. Unexpected GDB output from command “-exec-run“.
vscode出现 ERROR: Unable to start debugging. Unexpected GDB output from command “-exec-run“.
323 0
|
8月前
|
Unix Java Linux
Runtime.exec方法之获取process id
Runtime.exec方法之获取process id
148 0
|
11月前
|
关系型数据库 MySQL 数据库
ERROR! MariaDB is running but PID file could not be found
在CentOS7.6上安装了MariaDB10.3,采用的yum方式安装的,用命令查看数据库的状态会报错误
cl.exe is unable to create an executable file. C compiler test failed.
cl.exe is unable to create an executable file. C compiler test failed.
145 0
autoreconf: failed to run autopoint: No such file or directory
autoreconf: failed to run autopoint: No such file or directory
134 0
|
资源调度
yarn start error Command failed with exit code 1解决
yarn start error Command failed with exit code 1解决
872 0
|
Ubuntu Linux 应用服务中间件
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "ip": executable file not found in $PATH: unknown (Docker容器没有ip addr命令:exec ip addr 报错)
OCI runtime exec failed: exec failed: container_linux.go:380: starting container process caused: exec: "ip": executable file not found in $PATH: unknown (Docker容器没有ip addr命令:exec ip addr 报错)
3316 0
command exec make executable file not found in %PATH%
command exec make executable file not found in %PATH%
195 0
command exec make executable file not found in %PATH%
|
Windows Python
Fatal error in launcher:Unable to create process using
Windows 下同时存在 Python2 和 Python3 使用 pip 时系统报错:`Fatal error in launcher: Unable to create process using '"'` 的解决方案
5268 0
|
网络协议 Java 容器
【报错】项目启动,仅仅报错 One or more listeners failed to start. Full details will be found in the appropriate container log file
今天spring4.3.13 项目,整合ActiveMQ的时候,项目启动在自动部署到tomcat下的时候,不能正常的部署,仅仅报错如下: Connected to server [2017-12-08 03:57:12,428] Artifact springDemo:war exploded: Artifact is being deployed, please wait.
6163 0

热门文章

最新文章