1、编辑docker file
[root@DB docker]# vim mongodb.yml
mongo:
image: mongo
container_name: MyMongo_4
ports:
- "27017:27017"
volumes:
- "/data/mongodb:/data/db"
docker-compose -f mongodb.yml up -d mysql
docker -ps
mongo 127.0.0.1:27017
1、编辑docker file
[root@DB docker]# vim mongodb.yml
mongo:
image: mongo
container_name: MyMongo_4
ports:
- "27017:27017"
volumes:
- "/data/mongodb:/data/db"
docker-compose -f mongodb.yml up -d mysql
docker -ps
mongo 127.0.0.1:27017