面试 自承式光缆 bash eloquent webview build Minjs kali重启网卡 vue与html5 python逻辑运算符 python环境变量配置 python函数返回 java基础教学 java入门教程 java中接口的定义 java入门基础 java文件删除 远程登录linux linuxshell编程 圣骑士装备 找茬辅助 方正兰亭字体下载 电子书制作软件 php购物车 英雄联盟崩溃 存储过程写法 js分页 pr怎么放大视频画面 js发送http请求 cad视口旋转 windows游戏编程 foobar2000插件 oledbconnection 文件分割 dnf卡邮件 启用宏在哪里设置 win10工作组 devenv win10画图在哪里 wps宏的使用教程
当前位置: 首页 > 学习教程  > 编程语言

centos7 在docker下安装mongodb

2020/7/24 9:34:22 文章标签:

1、直接说明过程步骤:在docker中查找mongo相对应的版本

docker search mongo

得到下面一系列信息:

NAME                                DESCRIPTION                                     STARS               OFFICIAL            AUTOMATED
mongo                               MongoDB document databases provide high avai…   7050                [OK]                
mongo-express                       Web-based MongoDB admin interface, written w…   737                 [OK]                
tutum/mongodb                       MongoDB Docker image – listens in port 27017…   229                                     [OK]
bitnami/mongodb                     Bitnami MongoDB Docker Image                    123                                     [OK]
mongoclient/mongoclient             Official docker image for Mongoclient, featu…   85                                      [OK]
mongooseim/mongooseim               Small docker image for MongooseIM - robust a…   19                                      
frodenas/mongodb                    A Docker Image for MongoDB                      18                                      [OK]
cvallance/mongo-k8s-sidecar         Kubernetes side car to setup and maintain a …   16                                      [OK]
arm64v8/mongo                       MongoDB document databases provide high avai…   9                                       
centos/mongodb-32-centos7           MongoDB NoSQL database server                   8                                       
circleci/mongo                      CircleCI images for MongoDB                     8                                       [OK]
webhippie/mongodb                   Docker images for MongoDB                       7                                       [OK]
istepanov/mongodump                 Docker image with mongodump running as a cro…   6                                       [OK]
centos/mongodb-36-centos7           MongoDB NoSQL database server                   5                                       
centos/mongodb-26-centos7           MongoDB NoSQL database server                   5                                       
neowaylabs/mongodb-mms-agent        This Docker image with MongoDB Monitoring Ag…   4                                       [OK]
eses/mongodb_exporter               mongodb exporter for prometheus                 4                                       [OK]
requilence/mongodb-backup           mongo backup container                          4                                       [OK]
centos/mongodb-34-centos7           MongoDB NoSQL database server                   3                                       
andreasleicher/mongo-azure-backup   a docker container to backup a mongodb using…   2                                       [OK]
openshift/mongodb-24-centos7        DEPRECATED: A Centos7 based MongoDB v2.4 ima…   1                                       
ansibleplaybookbundle/mongodb-apb   An APB to deploy MongoDB.                       1                                       [OK]
ekesken/mongo                       docker image for mongo that is configurable …   1                                       [OK]
phenompeople/mongodb                 MongoDB is an open-source, document databas…   0                                       [OK]
targetprocess/mongodb_exporter      MongoDB exporter for prometheus  

2、拉取最新的mongo版本

docker pull mogo
[root@iZff0beo6kbg2nZ ~]# docker pull mongo
Using default tag: latest
latest: Pulling from library/mongo
a1125296b23d: Pull complete 
3c742a4a0f38: Pull complete 
4c5ea3b32996: Pull complete 
1b4be91ead68: Pull complete 
af8504826779: Pull complete 
8faaabd5f8b2: Pull complete 
b7bb90b3c1e5: Pull complete 
04f4b579cf84: Pull complete 
33b916e924f1: Pull complete 
a805b21b6014: Pull complete 
7775fed63862: Pull complete 
94226c388074: Pull complete 
bdf7bf6a32e9: Pull complete 
Digest: sha256:6d09cb4a2abbf0b333aa7e4f69c74d17699eeabf17f20a2265453bc8d1c1f5ac
Status: Downloaded newer image for mongo:latest
docker.io/library/mongo:latest

3、这个时候我们可以输入docker images命令查看我们所创建好的mongo容器:

[root@iZff0beo6kbg2nZ ~]# docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
mongo               latest              6d11486a97a7        2 weeks ago         388MB

4、创建容器并且运行:

[root@iZff0beo6kbg2nZ ~]# docker run -itd --name mongo -p 27017:27017 mongo
4af1e2b5bd108f8a934f656ab2de51688733deca8550e8a3cabb11c298922430

5、之后我们就可以进入我们的数据库进行操作了


本文链接: http://www.dtmao.cc/news_show_50121.shtml

附件下载

相关教程

    暂无相关的数据...

共有条评论 网友评论

验证码: 看不清楚?