查看运行中的docker run 命令
runlike -p docker-name
docker save redis:5.0.14 | gzip > ./redis5.0.14.tar.gz
docker load < redis5.0.14.tar.gz
# docker方式启动redis
docker run -d -p 7803:6379 --name redis -v /export/redis/config/redis.conf:/etc/redis/redis.conf -v /export/redis/data:/data redis:5.0.14 redis-server /etc/redis/redis.conf --appendonly yes
# redis配置文件需要新建/export/redis/config/redis.conf
#docker方式启动redis加密码
docker pull redis:5.0.14
docker run -d -p 7803:6379 --name redis -v /export/redis/config/redis.conf:/etc/redis/redis.conf -v /export/redis/data:/data redis:5.0.14 redis-server /etc/redis/redis.conf --appendonly yes --requirepass "123456"
# 测试查看
docker exec -it redis sh
# redis-cli
127.0.0.1:6379> config get requirepass
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> config get requirepass
1) "requirepass"
2) "123456"
rabbitmq
# docker方式启动rabbitmq ,建议至docker-hub 查找需要的版本
# https://hub.docker.com/
docker pull rabbitmq:3.8-management-alpine
docker run -d --name rabbitmq --env=RABBITMQ_DEFAULT_PASS='****' --env=RABBITMQ_DEFAULT_USER=test -p 7801:15672 -p 7802:5672 rabbitmq:3.8-management
mongo
docker pull mongo:4.2
docker run -d --name mongo -p 7815:27017 -v /data/mongo:/data/db -e MONGO_INITDB_ROOT_USERNAME=admin -e MONGO_INITDB_ROOT_PASSWORD=admin mongo:4.2
mysql
# mysql5.7
docker pull mysql:5.7
docker run -d -p 3306:3306 --name mysql \
-v /usr/local/docker/mysql/conf:/etc/mysql \
-v /usr/local/docker/mysql/logs:/var/log/mysql \
-v /usr/local/docker/mysql/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=123456 mysql:5.7
postgreSQL
# postgreSQL
docker pull postgis/postgis:12-3.1-alpine
docker run -d --name postgresql -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=123456 -e PG_VERSION=12.7 -e PGDATA=/var/lib/postgresql/data -e POSTGIS_VERSION=3.1.2 --volume=/var/lib/postgresql/data -p 7805:5432 --restart=always postgis/postgis:12-3.1-alpine