JavaScript进阶之路漫漫其修远兮。(~强烈建议使用Sublime编辑器查看本站给出的示例代码,因为它帅呆了~)

作者:田大才子2020-8-5 17:50分类: 其他

==========安装软件==========
yum install –y docker   ##默认安装

先配置阿里云镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://r63r5o6g.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

#拉取镜像
docker pull mysql:5.7

#目录挂载,并且设置mysql初始密码
docker run -p 9900:3306 --name docker-mysql -v /root/docker/mysql57/conf:/etc/mysql/conf.d -v /root/docker/mysql57/logs:/logs -v /root/docker/mysql57/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=tianhh@123 -d mysql:5.7

# reids 安装
docker pull redis


#目录挂载,并且设置redis连接密码
docker run -p 9901:6379 --name redis -v /root/docker/redis/redis.conf:/etc/redis/redis.conf -v /root/docker/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes --requirepass "tianhh@123"

# 安装tomcat 没用到
docker run  -p 18080:8080 -p 16002:16002 --name docker-tomcat8  -e JAVA_OPTS="-Duser.timezone=Asia/Shanghai" -v /root/docker/tomcat/webapp:/usr/local/tomcat/webapps -v /root/docker/tomcat/logs:/usr/local/tomcat/logs -v /etc/localtime:/etc/localtime   -d  tomcat:8

# 安装nginx
docker pull nginx:1.14.2

docker run --name nginx --network=host -d -p 80:80 -v /root/docker/nginx/nginx.conf:/etc/nginx/nginx.conf -v /root/docker/nginx/html:/etc/nginx/html -v /root/docker/nginx/logs:/var/log/nginx nginx:1.14.2

=========================

==========springboot项目制作镜像==========
https://www.jianshu.com/p/397929dbc27d

docker build -t tianqing-admin .
docker run -d -p 8080:9999 -v /root/docker/tianqing-admin/logs:/logs  tianqing-admin 

docker build -t tianqing-file .
docker run -d -p 8082:8081 -v /root/docker/tianqing-file/logs:/logs -v /root/docker/tianqing-file/TqAdmin:/TqAdmin tianqing-file

docker build -t tianqing-nongchang .
docker run -d -p 8081:5555 -v /root/docker/tianqing-nongchang/logs:/logs  tianqing-nongchang 

docker inspect 5667bb4ad256| grep IPAddress

=========================

==========地址==========
后台:http://nongchang.jzddyr.com/admin/login.html
前台:http://nongchang.jzddyr.com/weixin/home.html
=========================

温馨提示如有转载或引用以上内容之必要,敬请将本文链接作为出处标注,谢谢合作!

已有 0/3810 人参与

发表评论:

个人公众号,希望您的关注~