mysql
接取镜像:
docker pull mysql
启动mysql:
docker run --name mysql -d -p 3306:3306 --restart unless-stopped -v /mydata/mysql/log:/var/log/mysql -v /mydata/mysql/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
rabbitmq
拉取镜像:
docker pull rabbitmq
启动容器:
docker run --name rabbitmq -d -p 5672:5672 -p 15672:15672 --restart unless-stopped -e RABBITMQ_DEFAULT_USER=hbj111 -e RABBITMQ_DEFAULT_PASS=0401158h --privileged=true -v /mydata/rabbitmq:/var/lib/rabbitmq rabbitmq:latest
进入容器启动界面:
rabbitmq-plugins enable rabbitmq_management
管理地址:
http://localhost:15672
redis
拉取镜像:
docker pull redis
启动redis
docker run --restart=always -p 6379:6379 --name myredis -v /mydata/redis/redis.conf:/etc/redis/redis.conf -v /mydata/redis/data:/data -d redis:latest redis-server /etc/redis/redis.conf --requirepass 0401158h