# centos7安装 jumpserver
## docker 安装
```bash
sudo yum install -y yum-utils
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce docker-ce-cli containerd.io
yum list docker-ce --showduplicates | sort -r
yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io
systemctl start docker
docker run hello-world
```
## docker 安装`mysql`并映射数据,配置文件等
## `my.conf`配置参考
```
[client]
#客户端设置
port = 3306
[mysqld]
user = mysql
port = 3306
```
```bash
mkidr /jumpserver/mysql
pwd #打印文件位置
cd /jumpserver/mysql
mkdir conf
touch my.conf
vim my.conf #拷贝上面参考配置
cd /jumpserver/mysql
mkidr logs
mkdir data
docker run -itd --restart=always --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/var/log/mysql -v $PWD/data:/var/lib/mysql mysql:5.7.31
```
[配置文件参考连接](https://www.cnblogs.com/gne-hwz/p/10220179.html)
<br/>
[映射参考连接](https://www.cnblogs.com/l1ng14/p/14717889.html)
## docker 安装`redis`并映射数据,配置文件等
## `redis.conf`配置参考
```
port 6379
dir /data
logfile "/data/redis.log"
```
```bash
cd /jumpserver
mkidr /redis
pwd #打印文件位置
cd /redis
mkdir conf
touch redis.conf
vim my.conf #拷贝上面参考配置
cd /jumpserver/redis
mkdir data
# docker启动redis
docker run -itd --restart=always -p 6379:6379 -v $PWD/conf/redis.conf:/usr/local/etc/redis/redis.conf -v $PWD/data/:/data --name redis -e "TZ=Asia/Shanghai" redis redis-server /usr/local/etc/redis/redis.conf
```
有疑问加站长微信联系(非本文作者)