总结docker安装组件的执行命令,不用再费力百度测试是否合适,直接就可以拿来使用
1、安装mysql8
docker run -d --privileged=true --restart always --net host --name zhenjiang_mysql -v /app/zhenjiang/mysql/log:/var/log/mysql -v /app/zhenjiang/mysql/data:/var/lib/mysql -v /app/zhenjiang/mysql/conf:/etc/mysql -e MYSQL_ROOT_PASSWORD=root mysql:8.0
vim /app/zhenjiang/mysql/conf
[mysqld] #datadir=/usr/local/mysql/data default_authentication_plugin=mysql_native_password #使用mysql8以前的密码插件,以便navicat等工具能够正常连接 default-storage-engine=INNODB character_set_server = utf8 secure_file_priv=/var/lib/mysql [mysqld_safe] character_set_server = utf8 [mysql] default-character-set = utf8 [mysql.server] default-character-set = utf8 [client] default-character-set = utf8
2、安装redis6
docker run -d --privileged=true -v /app/zhenjiang/redis/conf/redis.conf:/etc/redis/redis.conf -v /app/zhenjiang/redis/data:/data --net host --restart always --name zhenjiang_redis redis:6.0.9 redis-server /etc/redis/redis.conf --requirepass "root" --appendonly yes