echo "系统更新..."; dnf -y update ; echo "安装JDK 17..."; dnf install -y java-17-openjdk-devel; echo "安装docker..."; dnf install -y docker; VOL_HOME=/home/docker; echo "安装MySQL 8..." mkdir -p $VOL_HOME/mysql/conf; MY_CNF=$VOL_HOME/mysql/conf/my.cnf echo '[mysqld]' > $MY_CNF; echo 'skip-host-cache' >> $MY_CNF; echo 'skip-name-resolve' >> $MY_CNF; echo 'datadir=/var/lib/mysql' >> $MY_CNF; echo 'socket=/var/run/mysqld/mysqld.sock' >> $MY_CNF; echo 'secure-file-priv=/var/lib/mysql-files' >> $MY_CNF; echo 'user=mysql' >> $MY_CNF; echo 'pid-file=/var/run/mysqld/mysqld.pid' >> $MY_CNF; echo 'lower_case_table_names=1' >> $MY_CNF; echo 'default-time_zone='+8:00'' >> $MY_CNF; echo '[client]' >> $MY_CNF; echo 'socket=/var/run/mysqld/mysqld.sock' >> $MY_CNF; docker run --name mysql \ -e TZ=Asia/Shanghai \ -e MYSQL_ROOT_PASSWORD=joycode \ -v $VOL_HOME/mysql/data:/var/lib/mysql \ -v $VOL_HOME/mysql/conf/my.cnf:/etc/my.cnf \ -p 3306:3306 \ -p 33060:33060 \ -d \ mysql:8 \ --character-set-server=utf8mb4 \ --collation-server=utf8mb4_general_ci echo "安装Redis..." mkdir -p $VOL_HOME/redis/conf/; echo 'requirepass joycode' > $VOL_HOME/redis/conf/redis.conf; echo 'ignore-warnings ARM64-COW-BUG' >> $VOL_HOME/redis/conf/redis.conf; docker run -d --name redis \ --restart=always \ -p 6379:6379 \ -v $VOL_HOME/redis/conf/redis.conf:/etc/redis/redis.conf \ -v $VOL_HOME/redis/data:/data \ redis \ redis-server /etc/redis/redis.conf \ --appendonly yes; echo "安装RabbitMQ..." docker run -d --name rabbitmq \ --restart=always \ -e RABBITMQ_DEFAULT_USER=admin \ -e RABBITMQ_DEFAULT_PASS=joycode \ -p 5672:5672 \ -p 15672:15672 \ -v $VOL_HOME/rabbitmq:/var/lib/rabbitmq/mnesia \ rabbitmq:management-alpine; firewall-cmd --zone=public --add-port=80/tcp --permanent; firewall-cmd --zone=public --add-port=3306/tcp --permanent; firewall-cmd --zone=public --add-port=6379/tcp --permanent; firewall-cmd --zone=public --add-port=5672/tcp --permanent; firewall-cmd --zone=public --add-port=15672/tcp --permanent; firewall-cmd --reload;
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END