docker安裝並運行mongo

  拉鏡像:docker

[mall@VM_0_7_centos ~]$ sudo docker pull mongo:3.2
[sudo] password for mall: 
3.2: Pulling from library/mongo
a92a4af0fb9c: Pull complete 
74a2c7f3849e: Pull complete 
927b52ab29bb: Pull complete 
e941def14025: Pull complete 
be6fce289e32: Pull complete 
f6d82baac946: Pull complete 
7c1a640b9ded: Pull complete 
e8b2fc34c941: Pull complete 
1fd822faa46a: Pull complete 
61ba5f01559c: Pull complete 
db344da27f9a: Pull complete 
Digest: sha256:0463a91d8eff189747348c154507afc7aba045baa40e8d58d8a4c798e71001f3
Status: Downloaded newer image for mongo:3.2
docker.io/library/mongo:3.2

  啓動:centos

[mall@VM_0_7_centos ~]$ sudo docker run -p 27017:27017 --name mongo \
>   -v /mydata/mongo/db:/data/db \
>   -d mongo:3.2
16ab1e8c870497b823e2f2764aeaab90a6830a0360c0f386324b130049c0f863

  查看進程是否起來:tcp

[mall@VM_0_7_centos ~]$ sudo docker ps | grep mongo
16ab1e8c8704        mongo:3.2             "docker-entrypoint.s…"   About a minute ago   Up About a minute   0.0.0.0:27017->27017/tcp                                                                                                   mongo
相關文章
相關標籤/搜索