docker快速部署redis,mysql,mongodb等开发环境

  |   0 评论   |   0 浏览

docker run -d --restart always -p 8080:8080 -p 50000:50000 -v /data/jenkins/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime --name myjenkins jenkins

docker run -d --restart always -p 27017:27017 -v /data/mongo/data:/data/db --name mymongo
-e MONGO_INITDB_ROOT_USERNAME=mongoadmin
-e MONGO_INITDB_ROOT_PASSWORD=secret
mongo

$ docker run -d --network some-network --name some-mongo
-e MONGO_INITDB_ROOT_USERNAME=mongoadmin
-e MONGO_INITDB_ROOT_PASSWORD=secret
mongo

mongoadmin:secret

connect to mongo:
docker run -it --rm mongo
mongo --host 172.17.0.3
-u mongoadmin
-p secret
--authenticationDatabase admin
test

redis:
$ docker run -v /myredis/conf/redis.conf:/usr/local/etc/redis/redis.conf --name myredis Redis redis-server /usr/local/etc/redis/redis.conf

docker run -d
--restart always
-p 6379:6379
-v /etc/localtime:/etc/localtime
-v /data/redis/data:/data
--name myredis
Redis redis-server --appendonly yes

connect to redis:
docker run -it --rm Redis redis-cli -h 172.17.0.4


标题:docker快速部署redis,mysql,mongodb等开发环境
作者:SmiteLi
地址:https://smite.site/articles/2020/02/21/1582298346369.html

评论

发表评论