├── .gitignore ├── AutoDeploy_tomcat ├── catalina.sh ├── deploy.sh ├── deploy_shark.sh ├── environment_init.sh ├── logging.properties ├── optimize_conf.sh └── server.xml ├── BT宝塔面板 └── 宝塔Linux面板.md ├── CentOS Docker 安装.md ├── CentOS ├── CentOS 6.x 安装配置.md ├── CentOS Docker 安装.md ├── CentOS7安装详解.md ├── VMware 安装 Centos7 超详细过程.md ├── VMware安装Centos7超详细过程(图文).md ├── centos6-optimization │ ├── Yum 安装 Percona Server.txt │ ├── epel.sh │ ├── fail2ban.txt │ ├── golang.txt │ ├── iptables.sh │ ├── iptables相关错误.txt │ ├── mysql主主备份.txt │ ├── mysql主从备份.txt │ ├── mysql命令行建立远程用户和授权.txt │ ├── postgres.txt │ ├── 主机名和DNS.txt │ ├── 关闭IPv6的支持.txt │ ├── 关闭selinux.txt │ ├── 内核参数优化.txt │ ├── 更新时间.txt │ ├── 添加普通用户并进行sudo授权管理.txt │ ├── 精简开机自启动服务.txt │ └── 设置最大打开文件数.txt ├── centos6安装教程.md ├── linux常用RPM源.md └── 超详细的CentOS7.4下载与图文安装.md ├── DOCKER_HELPER.md ├── Docker 镜像加速.md ├── Dockerfiles ├── .gitignore ├── LICENSE ├── README.md ├── debian-jre8-weixin │ ├── Dockerfile │ └── README.md ├── debian-jre8 │ ├── Dockerfile │ └── README.md ├── jre8-tomcat8-weixin │ ├── Dockerfile │ └── README.md ├── jre8-tomcat8 │ ├── Dockerfile │ └── README.md └── zub-server-610 │ ├── Dockerfile │ └── README.md ├── Docker容器设置开机启动.md ├── Docker容器迁移(从一台服务器到另外一台服务器).md ├── Docker常用镜像.md ├── Docker镜像大礼包 ├── README.md └── elk │ ├── csphere-elk │ ├── Dockerfile │ ├── logstash-forwarder.crt │ └── logstash-forwarder.key │ ├── elk-compose.yml │ └── logstash-forwarder │ ├── Dockerfile │ ├── logstash-forwarder.conf │ ├── logstash-forwarder.crt │ ├── supervisor_logstash-forwarder.conf │ └── supervisor_rsyslog.conf ├── Gcc&lib ├── GCC一键安装新版.md ├── README.md └── linux下各安装包的安装方法.md ├── JDK ├── Centos7 安装 jdk8 java8 以及配置环境变量.md ├── linux下yum安装JDK8.md └── 快速优雅的在linux服务器上安装jdk8.md ├── Kubernetes-1.12.3-all-auto-install ├── README.MD ├── harbor-install.sh ├── kubernetes-dashboard-admin.rbac.yaml ├── kubernetes-dashboard.yaml ├── nginx-ingress-controller_install.sh ├── node_kubeadm_init.sh ├── node_kubeadm_install.sh └── node_kubeadm_join.sh ├── LVS └── LVS安装使用详解.md ├── Linux.md ├── NodeJS ├── Nodejs介绍及npm工具使用.md ├── npm更换阿里源.md └── npm的镜像替换成淘宝.md ├── README.md ├── Ubuntu Docker 安装.md ├── Windows Docker 安装.md ├── docker-Activemq ├── ActiveMQ消息中间件使用详解.md └── docker 安装 activeMQ.md ├── docker-Centos ├── Docker 安装 CentOS.md ├── Dockerfile ├── docker-centos7 │ ├── Dockerfile │ ├── aliyun-epel.repo │ ├── aliyun-mirror.repo │ └── supervisord.conf ├── run.sh └── set_root_pw.sh ├── docker-Dubbo ├── Dubbo 一篇文章就够了:从入门到实战.md ├── README.md └── docker安装 dubbo.md ├── docker-Elasticsearch ├── Docker部署ElasticSearch及使用.md ├── Elasticsearch开发人员最佳实战指南.md ├── Elasticsearch-基础1.md └── Elasticsearch-基础介绍及索引原理分析.md ├── docker-Fastdfs ├── FastDFS 分布式文件系统部署实战及基本使用.md ├── FastDFS一步步搭建文件管理系统.md └── docker安装FastDFS.md ├── docker-Gitlab ├── Docker搭建GitLab私有代码仓库.md ├── Gitlab │ ├── Gitlab快速部署及日常维护(社区版RPM包方式安装).md │ ├── README.md │ └── gitlab docker安装以及使用.md ├── docker-gitlab-zh │ ├── .dockerignore │ ├── .gitignore │ ├── Changelog.md │ ├── Dockerfile │ ├── Makefile │ ├── README.md │ ├── VERSION │ ├── assets │ │ ├── config │ │ │ ├── gitlab-shell │ │ │ │ └── config.yml │ │ │ ├── gitlabhq │ │ │ │ ├── database.yml │ │ │ │ ├── gitlab.yml │ │ │ │ ├── rack_attack.rb │ │ │ │ ├── resque.yml │ │ │ │ ├── robots.txt │ │ │ │ ├── smtp_settings.rb │ │ │ │ └── unicorn.rb │ │ │ └── nginx │ │ │ │ ├── gitlab │ │ │ │ └── gitlab-ssl │ │ └── setup │ │ │ └── install.sh │ ├── docker-compose.yml │ └── entrypoint.sh ├── rebuild master.md └── 重置master分支.md ├── docker-Jenkins ├── Docker 快速安装Jenkins完美教程 (亲测采坑后详细步骤).md ├── Jenkins快速上手.md ├── Jenkins自动化部署入门详细教程.md ├── README.md ├── docker-jenkins-v2 │ └── Dockerfile ├── docker-jenkins │ ├── Dockerfile │ ├── README.md │ ├── consoleoutput.png │ ├── init.groovy │ ├── jenkins.sh │ └── plugins.txt ├── jenkins-前端shell脚本 ├── jenkins-后端shell脚本 ├── jenkins详解.md └── 使用Docker安装Jenkins.md ├── docker-Jmeter └── docker 创建 jmeter.md ├── docker-Maven ├── Centos安装maven及环境变量配置.md ├── catalog.xml ├── context_shiro.xml ├── docker-maven │ ├── .gitignore │ ├── Dockerfile │ ├── hello │ │ ├── .mymetadata │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ ├── csphere │ │ │ │ └── xc │ │ │ │ │ ├── dao │ │ │ │ │ └── user_select.java │ │ │ │ │ └── po │ │ │ │ │ ├── User.java │ │ │ │ │ └── User.xml │ │ │ ├── log4j.properties │ │ │ └── sqlMapConfig.xml │ │ │ └── webapp │ │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ │ ├── WEB-INF │ │ │ └── web.xml │ │ │ └── index.jsp │ └── settings.xml ├── log4j2-prod.xml └── settings-test.xml ├── docker-MongoDB └── Docker 安装 MongoDB.md ├── docker-Mysql ├── Docker 安装 MySQL.md ├── docker-mysql-v2 │ ├── Dockerfile │ └── mysqld_charset.cnf └── docker-mysql │ ├── Dockerfile │ ├── build-imysql-v2 │ ├── Dockerfile │ └── README.md │ ├── import_sql.sh │ ├── my.cnf │ ├── mysqld_charset.cnf │ ├── run.sh │ └── scripts │ ├── firstrun │ ├── firstrun_maria │ └── start ├── docker-Node.js └── Docker 安装 Node.js.md ├── docker-Oracle └── docker安装oracle数据库.md ├── docker-PHP └── Docker 安装 PHP.md ├── docker-PostgreSQL ├── PostgreSQL用户说明.txt └── docker安装postgresql.md ├── docker-Python └── Docker 安装 Python.md ├── docker-Redis ├── Docker 安装 Redis.md ├── Dockerfile ├── README.md ├── redis.conf ├── redis.default.conf └── redis1.conf ├── docker-Rocketmq └── docker安装RocketMQ.md ├── docker-SSDB └── docker部署ssdb.md ├── docker-Sonar └── Docker安装Sonar.md ├── docker-Spring-cloud-alibaba ├── Docker composer搭建Spring Cloud Alibaba 运行环境.md └── SpringCloudAlibaba微服务docker容器打包和部署示例实战.md ├── docker-Springcloud └── Docker 部署 Spring Cloud 项目.md ├── docker-TFS └── Docker部署TFS.md ├── docker-Tomcat ├── Docker 安装 Tomcat.md ├── docker-tomcat │ ├── .gitignore │ ├── 7.0 │ │ ├── Dockerfile │ │ ├── create_tomcat_admin_user.sh │ │ └── run.sh │ ├── 8.0 │ │ ├── Dockerfile │ │ ├── create_tomcat_admin_user.sh │ │ └── run.sh │ ├── CentOS7 安装Tomcat9.md │ ├── Docker 安装 Tomcat.md │ ├── Dockerfile │ ├── Linux(CentOS7)安装Tomcat与设置Tomcat为开机启动项.md │ ├── README.md │ └── scripts │ │ ├── create_tomcat_admin_user │ │ ├── firstrun │ │ └── run ├── docker-tomcat7 │ └── Dockerfile └── docker-tomcat8 │ ├── Dockerfile │ ├── README.md │ └── tomcat-users.xml ├── docker-Ubuntu ├── Docker 安装 Ubuntu.md ├── docker-study │ ├── README.md │ ├── redis │ │ └── Dockerfile │ └── ssh │ │ └── Dockerfile └── docker-ubuntu-apache2-supervisord │ ├── Dockerfile │ ├── README.md │ ├── apache2 │ ├── apache2.conf │ ├── help.txt │ ├── ports.conf │ ├── sites-available │ │ ├── 000-default.conf │ │ ├── default-ssl.conf │ │ └── help.txt │ └── sites-enabled │ │ ├── 000-default.conf │ │ └── help.txt │ ├── apt │ ├── help.txt │ └── sources.list │ ├── supervisor │ ├── conf.d │ │ └── supervisord.conf │ ├── help.txt │ └── supervisord.conf │ └── thumbnail.png ├── docker-WebSphereMQ ├── Dockerfile ├── Dockerfile2 ├── README.md ├── start_queue_manager.sh └── supervisord.conf ├── docker-Wordpress ├── Docker搭建Wordpress.md ├── docker-wordpress │ ├── .dockerignore │ ├── .htaccess │ ├── Dockerfile │ ├── run.sh │ ├── wordpress.conf │ └── wp-config.php ├── docker_wordpress.md └── 使用Docker搭建一个WordPress博客.one ├── docker-Zookeeper └── docker方式搭建zookeeper集群.md ├── docker-alpine ├── Dockerfile ├── README.md ├── alpine-java │ ├── alpine-java-build.sh │ ├── alpine-java-dockerfile │ └── alpine-java-run.sh ├── alpine-singleapp │ ├── alpine-singleapp-build.sh │ ├── alpine-singleapp-dockerfile │ └── alpine-singleapp-run.sh ├── alpine-sshd │ ├── alpine-sshd-build.sh │ ├── alpine-sshd-dockerfile │ ├── alpine-sshd-run.sh │ └── docker-entrypoint.sh ├── alpine-tomcatapp │ ├── alpine-tomcatapp-build.sh │ ├── alpine-tomcatapp-dockerfile │ └── alpine-tomcatapp-run.sh ├── build.sh └── push.txt ├── docker-apache ├── Docker 安装 Apache.md └── docker-apache-php │ ├── Dockerfile │ ├── run.sh │ └── sample │ ├── index.php │ └── logo.png ├── docker-compose ├── docker-compose-list │ └── README.md ├── docker-compose-mnpr │ ├── README.md │ ├── docker-compose.yaml │ ├── index.html │ ├── index.php │ ├── mysql │ │ ├── Dockerfile │ │ ├── docker-entrypoint.sh │ │ └── sql │ │ │ └── docker_demo.sql │ └── nginx │ │ └── conf.d │ │ └── default.conf └── docker-compose │ ├── Dockerfile │ ├── README.md │ ├── conf │ ├── mysql │ │ └── mysql.cnf │ ├── nginx │ │ ├── default.conf │ │ ├── new.conf │ │ └── upload.conf │ └── php │ │ ├── docker-php-ext-pdo_mysql.ini │ │ ├── docker-php-ext-redis.ini │ │ ├── exts.ini │ │ └── upload-setting.ini │ ├── docker-compose.yml │ ├── docker.cmd │ └── html │ └── mina │ └── .env.example ├── docker-disconf ├── DockerDisconf │ ├── disconf-app │ │ ├── Dockerfile │ │ └── server.xml │ ├── disconf-build │ │ ├── Dockerfile │ │ └── config │ │ │ ├── application.properties │ │ │ ├── jdbc-mysql.properties │ │ │ ├── redis-config.properties │ │ │ └── zoo.properties │ ├── disconf-compose │ │ └── docker-compose.yml │ ├── disconf-mysql │ │ └── files │ │ │ └── sql │ │ │ ├── .gitignore │ │ │ ├── 1-init_table.sql │ │ │ ├── 2-data.sql │ │ │ ├── 3-20141201-disconf.sql │ │ │ ├── 4-20141226-disconf.sql │ │ │ ├── 5-20150101-disconf.sql │ │ │ ├── 6-20150320-disconf.sql │ │ │ └── README.md │ ├── disconf-nginx │ │ └── nginx.conf │ └── disconf-zoo │ │ └── Dockerfile └── README.md ├── docker-hadoop └── docker安装hadoop集群.md ├── docker-httpd └── docker中部署httpd服务.md ├── docker-java-web ├── .gitignore ├── README.md ├── build │ └── tomcat │ │ ├── Dockerfile │ │ └── server.xml ├── docker-compose.yml.temp ├── shutdown.sh ├── start.sh └── uninstall.sh ├── docker-jdk └── Dockerfile ├── docker-jira ├── docker-jira │ ├── Dockerfile │ ├── docker-compose.yml │ ├── docker-entrypoint.sh │ └── readme.md └── docker部署 jira.md ├── docker-kafka ├── docker-kafka │ ├── Dockerfile │ ├── README.md │ ├── docker-compose.yml │ ├── download-kafka.sh │ ├── local-kafka-manager.sh │ ├── start-kafka.sh │ └── supervisord.conf └── docker安装kafka.md ├── docker-mycat ├── Docker下安装Mycat.md ├── Mycat-Web-国内加速下载.md ├── MycatLB下载地址.md ├── README.md └── mycat1.6实现单库分表.md ├── docker-nacos └── docker方式部署nacos.md ├── docker-nexus └── docker安装nexus.md ├── docker-oracle11g ├── 01preinstall │ ├── 01build.sh │ ├── 02run.sh │ └── dockerfile ├── 02installed │ ├── 01build.sh │ ├── 02run.sh │ ├── assets │ │ ├── colorecho │ │ ├── conf │ │ │ └── profile │ │ ├── db_install.sh │ │ ├── resp │ │ │ └── db_install.rsp │ │ └── set_profile.sh │ └── dockerfile ├── 03database │ ├── 01build.sh │ ├── 02run.sh │ ├── assets │ │ ├── colorecho │ │ ├── db_create.sh │ │ ├── db_delete.sh │ │ ├── entrypoint_oracle.sh │ │ ├── net_create.sh │ │ ├── resp │ │ │ ├── db_create.rsp │ │ │ ├── db_delete.rsp │ │ │ ├── em_create.rsp │ │ │ └── net_create.rsp │ │ └── sql │ │ │ └── init-user.sql │ ├── dockerfile │ └── entrypoint.sh └── README.md ├── docker-php-fpm ├── Dockerfile ├── nginx_default.conf ├── nginx_nginx.conf ├── php_www.conf ├── supervisor_nginx.conf └── supervisor_php-fpm.conf ├── docker-phpMyAdmin └── Docker 容器中运行 PHPMyAdmin的详细步骤.md ├── docker-weblogic └── Docker部署weblogic、WebSphere.md ├── elk-docker-compose ├── .env ├── README.md ├── docker-compose.yml ├── elasticsearch │ ├── config │ │ ├── elasticsearch.keystore │ │ ├── elasticsearch.yml │ │ ├── jvm.options │ │ ├── log4j2.file.properties │ │ ├── log4j2.properties │ │ ├── role_mapping.yml │ │ ├── roles.yml │ │ ├── users │ │ └── users_roles │ └── data │ │ └── .gitkeep ├── kibana │ └── config │ │ ├── kibana.yml │ │ └── node.options └── logstash │ ├── config │ ├── jvm.options │ ├── log4j2.properties │ ├── logstash-sample.conf │ ├── logstash.yml │ ├── pipelines.yml │ └── startup.options │ └── pipeline │ └── logstash.conf ├── install-docker ├── .gitattributes ├── .gitignore ├── README.md ├── images │ └── hello-world.tar ├── install-docker-offline.sh └── install-docker.sh ├── k3s-yaml ├── K3D,一个容器,但是一整个k8s集群.md ├── k3s入门--踩坑解决AutoK3s运行K3d集群.md ├── k3s在线和离线安装过程.md ├── windows目录映射到另外一个目录.md ├── 基于k3s部署Nginx、MySQL、Golang和Redis的详细教程.md ├── 基于k3s部署Nginx、MySQL、PHP和Redis的详细教程.md ├── 基于k3s部署Nginx、MySQL、SpringBoot和Redis的详细教程.md ├── 微信公众号支付和H5支付开发总结 #28.md ├── 生产环境使用k3s避雷指南:避免数据丢失与不可恢复.md └── 解决部署RKE2或K3S -无法拉取镜像办法.md ├── k8s-chart ├── LICENSE ├── README.en.md ├── README.md ├── app-ingress.yaml ├── gateway │ ├── .helmignore │ ├── Chart.yaml │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ ├── hpa.yaml │ │ └── service.yaml │ └── values.yaml ├── order │ ├── .helmignore │ ├── Chart.yaml │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ ├── hpa.yaml │ │ ├── secret.yaml │ │ └── service.yaml │ └── values.yaml ├── product │ ├── .helmignore │ ├── Chart.yaml │ ├── templates │ │ ├── NOTES.txt │ │ ├── _helpers.tpl │ │ ├── deployment.yaml │ │ ├── hpa.yaml │ │ └── service.yaml │ └── values.yaml └── user │ ├── .helmignore │ ├── Chart.yaml │ ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── deployment.yaml │ ├── hpa.yaml │ └── service.yaml │ └── values.yaml ├── mysql-master-slave-docker-compose ├── .env ├── README.md ├── conf │ ├── master │ │ └── my.cnf │ └── slave │ │ └── my.cnf └── docker-compose.yml ├── oschina-config ├── README.md ├── cdn │ ├── nginx.conf │ └── oschina.conf ├── common │ ├── gzip.conf │ └── proxy.conf ├── main │ ├── deny.conf │ ├── my.conf │ ├── nginx.conf │ ├── oschina.conf │ ├── realip.conf │ ├── robot.conf │ ├── team.conf │ └── upstream.conf ├── mysql │ └── my.cnf └── tomcat │ ├── catalina.sh │ ├── logging.properties │ └── server.xml ├── pom.xml └── shell ├── nodejs └── npm-run-serve.sh ├── server ├── aria2c │ ├── aria2c-server.sh │ └── aria2c.sh ├── frp │ ├── frpc.sh │ └── frps.sh ├── jetty │ ├── jetty.services │ └── jetty.sh ├── mongodb │ ├── mongodb.conf │ ├── mongodb.service │ └── mongodb.sh ├── mysql │ └── mysql.server ├── nc │ └── nc-server.sh ├── nginx │ ├── nginx.service │ ├── nginx.sh │ └── nginx.sh-yum.txt ├── php │ └── php-fpm.sh ├── redis │ ├── redis-cluster.sh │ └── redis.sh ├── tomcat │ ├── 7.0.82 │ │ ├── catalina.sh │ │ ├── setclasspath.sh │ │ └── startup.sh │ ├── GetAppHome.sh │ ├── startup.sh │ ├── tomcat-offical.sh │ └── tomcat.sh ├── webssh │ └── webssh.sh └── xampp │ ├── apache.sh │ └── xampp.sh └── springboot ├── fastjar-1.2.sh ├── fastjar.sh ├── ibot-robot-ui-lxqzw.sh ├── jeesite.sh ├── spring-boot-v1.1.sh ├── spring-boot-v1.2.sh └── spring-boot.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | .DS_Store 3 | application.pid 4 | 5 | # Mobile Tools for Java (J2ME) 6 | .mtj.tmp/ 7 | 8 | # Package Files # 9 | # *.jar 10 | *.war 11 | *.ear 12 | 13 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 14 | hs_err_pid* 15 | 16 | # Eclipse 17 | .classpath 18 | .project 19 | target 20 | bin 21 | classes 22 | .settings 23 | .factorypath 24 | doc2 25 | doc1 26 | *bak 27 | log 28 | logs 29 | target 30 | *.zip 31 | 32 | node_modules 33 | 34 | # Idea 35 | .idea 36 | *.iml 37 | .mvn 38 | 39 | # git 40 | *.orig -------------------------------------------------------------------------------- /AutoDeploy_tomcat/environment_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 远程主机名称 4 | REMOTE_HOST="10.100.19.104" 5 | # 远程主机用户 6 | REMOTE_USER=yanfa 7 | # OPT_DIR 8 | OPT_DIR=/home/yanfa/opt 9 | # TOMCAT_NAME 10 | TOMCAT_NAME=apache-tomcat-7.0.77 11 | # 远程主机Tomcat安装目录 12 | TOMCAT_DIR=${OPT_DIR}"/"${TOMCAT_NAME} 13 | 14 | # JDK_NAME 15 | JDK_NAME=jdk-7u80-linux-x64 16 | 17 | 18 | # 本地文件目录 19 | LOCAL_DIR=/Users/TaoBangren/eagle/dubbokeeper/deploy 20 | 21 | # Tomcat安装 22 | install_tomcat(){ 23 | for host in ${REMOTE_HOST};do 24 | echo "创建opt目录" 25 | ssh ${REMOTE_USER}@${host} "mkdir -p" ${OPT_DIR} 26 | 27 | echo "上传tomcat安装包" 28 | scp ${LOCAL_DIR}"/"${TOMCAT_NAME}".tar.gz" ${REMOTE_USER}@${host}:${OPT_DIR} 29 | 30 | echo "解压tomcat安装包" 31 | ssh ${REMOTE_USER}@${host} "cd" ${OPT_DIR} "&& tar zxvf "${TOMCAT_NAME}".tar.gz" 32 | done 33 | } 34 | 35 | # JDK安装 36 | install_jdk(){ 37 | for host in ${REMOTE_HOST};do 38 | echo "上传JDK安装包" 39 | scp ${LOCAL_DIR}"/"${JDK_NAME}".rpm" ${REMOTE_USER}@${host}:${OPT_DIR} 40 | 41 | echo "安装JDK" 42 | ssh ${REMOTE_USER}@${host} "cd" ${OPT_DIR} "&& sudo rpm -ivh "${JDK_NAME}".rpm" 43 | 44 | echo "检查JDK是否成功" 45 | ssh ${REMOTE_USER}@${host} "java -version" 46 | done 47 | } 48 | 49 | # 代码执行选项设置 50 | main(){ 51 | # install_tomcat; 52 | install_jdk; 53 | } 54 | 55 | main 56 | -------------------------------------------------------------------------------- /AutoDeploy_tomcat/optimize_conf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 远程主机名称 4 | REMOTE_HOST="10.100.19.106" 5 | # 远程主机用户 6 | REMOTE_USER=yanfa 7 | # 远程主机Tomcat安装目录 8 | TOMCAT_DIR=/home/yanfa/opt/apache-tomcat-7.0.77 9 | 10 | # 本地文件目录 11 | LOCAL_DIR=/Users/TaoBangren/eagle/shark/trunk/deploy 12 | 13 | # Tomcat优化配置 14 | optimize_tomcat(){ 15 | for host in ${REMOTE_HOST};do 16 | echo "停服..." 17 | ssh ${REMOTE_USER}@${host} "sh" ${TOMCAT_DIR}"/bin/shutdown.sh" 18 | 19 | echo "删除webapps下所有文件" 20 | ssh ${REMOTE_USER}@${host} "rm -rf" ${TOMCAT_DIR}"/webapps/*" 21 | 22 | echo "删除server/webapps下所有文件" 23 | ssh ${REMOTE_USER}@${host} "rm -rf" ${TOMCAT_DIR}"/server/webapps/*" 24 | 25 | echo "上传server.xml" 26 | ssh ${REMOTE_USER}@${host} "cd" ${TOMCAT_DIR}"/conf && mv server.xml server.xml.bak" 27 | scp ${LOCAL_DIR}"/server.xml" ${REMOTE_USER}@${host}:${TOMCAT_DIR}"/conf/" 28 | 29 | echo "上传catalina.sh" 30 | ssh ${REMOTE_USER}@${host} "cd" ${TOMCAT_DIR}"/bin && mv catalina.sh catalina.sh.bak" 31 | scp ${LOCAL_DIR}"/catalina.sh" ${REMOTE_USER}@${host}:${TOMCAT_DIR}"/bin/" 32 | 33 | echo "上传logging.properties" 34 | ssh ${REMOTE_USER}@${host} "cd" ${TOMCAT_DIR}"/conf && mv logging.properties logging.properties.bak" 35 | scp ${LOCAL_DIR}"/logging.properties" ${REMOTE_USER}@${host}:${TOMCAT_DIR}"/conf/" 36 | done 37 | } 38 | 39 | # 代码执行选项设置 40 | main(){ 41 | case $1 in 42 | tomcat) 43 | optimize_tomcat; 44 | ;; 45 | rollback_list) 46 | rollback_list; 47 | ;; 48 | rollback_pro) 49 | rollback_pro $2; 50 | record_log; 51 | ;; 52 | *) 53 | usage; 54 | esac 55 | } 56 | main $1 $2 57 | -------------------------------------------------------------------------------- /BT宝塔面板/宝塔Linux面板.md: -------------------------------------------------------------------------------- 1 | ## 宝塔Linux面板环境 2 | 3 | [点击去>>Linux版和Window版安装使用(宝塔官网使用教程)](https://www.bt.cn/?invite_code=MV9ya3Rpb2o=) 4 | 5 | 1、操作系统:全新系统(支持CentOS、Ubuntu、Debian、Fedora、Deepin) 6 | 7 | 2、确保是干净的操作系统,没有安装过其它环境带的Apache/Nginx/php/MySQL 8 | 9 | 3、宝塔Linux6.0版本是基于centos7开发的,强烈建议使用centos7.x 系统 10 | 11 | 4、内存要求:内存要求最低512MB,推荐768MB以上,纯面板约占系统60MB内存 12 | 13 | ## Linux安装宝塔面板方法 14 | 15 | 1.对硬盘进行挂载 16 | 17 | 使用SSH工具连接到你的云服务器,运行挂载命令: 18 | 19 | > ``` 20 | > yum install wget -y && wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh 21 | > ``` 22 | 23 | 24 | 出现提示按Y回车 25 | 26 | 27 | 28 | 2.执行宝塔安装命令 29 | 30 | 31 | 32 | Centos安装命令: 33 | 34 | > ``` 35 | > yum install -y wget && wget -O install.sh https://download.bt.cn/install/install_6.0.sh && sh install.sh ed8484bec 36 | > ``` 37 | 38 | Ubuntu/Deepin安装命令: 39 | 40 | > ``` 41 | > wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh ed8484bec 42 | > ``` 43 | 44 | Debian安装命令: 45 | 46 | > ``` 47 | > wget -O install.sh https://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh ed8484bec 48 | > ``` 49 | 50 | Fedora安装命令: 51 | 52 | > ``` 53 | > wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh 54 | > ``` 55 | 56 | 万能安装脚本: 57 | 58 | > ``` 59 | > if [ -f /usr/bin/curl ];then curl -sSO https://download.bt.cn/install/install_panel.sh;else wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh;fi;bash install_panel.sh ed8484bec 60 | > ``` -------------------------------------------------------------------------------- /CentOS/centos6-optimization/epel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # install epel 4 | su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' 5 | rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 6 | 7 | # install rpmfusion 8 | su -c 'yum localinstall -y --nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/x86_64/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/x86_64/rpmfusion-nonfree-release-6-1.noarch.rpm' 9 | 10 | # update base repo 11 | mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 12 | wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 13 | mv CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo 14 | 15 | yum install -y yum-priorities 16 | 17 | yum makecache 18 | 19 | # update 20 | yum update -y -------------------------------------------------------------------------------- /CentOS/centos6-optimization/fail2ban.txt: -------------------------------------------------------------------------------- 1 | 1、yum install fail2ban 2 | 3 | 4 | 2、fail2ban.conf说明 5 | 6 | vim /etc/fail2ban/fail2ban.conf 7 | 8 | 内有三行定义内容: 9 | 10 | [Definition] 11 | loglevel = 3 #定义日志输出级别 12 | logtarget = SYSLOG #定义日志目标,由syslog服务管理 13 | socket = /var/run/fail2ban/fail2ban.sock #设置socket文件,用于和后台的守护进程通讯 14 | 15 | 修改: 16 | 17 | logtarget = /var/log/fail2ban.log 18 | 19 | 20 | 4、编辑全局配置文件 21 | 这里设置为,如果同一个IP在10分钟内登录错误5次就ban IP一个星期。 22 | 23 | vim /etc/fail2ban/jail.conf 24 | 25 | 找到[DEFAULT]区块,修改以下内容: 26 | 27 | bantime = 86400 #设置IP禁止时间(秒),值为-1,代表永远禁止 28 | findtime = 600 #设置在多少时间(秒)范围内达到最大尝试次数 29 | 30 | 找到[ssh-iptables]区块,修改以下内容: 31 | 32 | maxretry = 5 #设置ssh允许尝试次数 33 | 34 | 5、启动fail2ban 35 | 36 | service fail2ban start 37 | 38 | 6、设置开机自启动 39 | 40 | chkconfig fail2ban on 41 | 42 | 43 | PS:除了iptables,还有其它可以用于fail2ban的软件 44 | shorewall:iptables防火墙配置工具 45 | TCP Wrapper:限制连接来源的工具 46 | Gamin:实时监视文件或文件夹变动的工具 -------------------------------------------------------------------------------- /CentOS/centos6-optimization/golang.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/golang.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/iptables相关错误.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/iptables相关错误.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/mysql主主备份.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/mysql主主备份.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/mysql主从备份.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/mysql主从备份.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/mysql命令行建立远程用户和授权.txt: -------------------------------------------------------------------------------- 1 | 首先在root用户下: 2 | 3 | mysql -uroot -p 4 | 输入密码 5 | 6 | mysql> create user 'tuyang'@'%' identified by '88382520'; 7 | Query OK, 0 rows affected (0.00 sec) 8 | 9 | mysql> grant all privileges on *.* to 'tuyang'@'%'; 10 | Query OK, 0 rows affected (0.00 sec) 11 | 12 | mysql> flush privileges; 13 | Query OK, 0 rows affected (0.00 sec) 14 | 15 | 16 | grant all PRIVILEGES on wap1.* to outlook@'%' identified by '123456'; 17 | flush privileges; 18 | 19 | wap1 dbname 20 | outlook user 21 | % all ip 22 | 123456 password -------------------------------------------------------------------------------- /CentOS/centos6-optimization/主机名和DNS.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/主机名和DNS.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/关闭IPv6的支持.txt: -------------------------------------------------------------------------------- 1 | [root@localhost ~]# chkconfig ip6tables off 2 | 3 | cat <>/etc/modprobe.d/dist.conf 4 | alias net-pf-10 off 5 | alias ipv6 off 6 | EOF -------------------------------------------------------------------------------- /CentOS/centos6-optimization/关闭selinux.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/关闭selinux.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/内核参数优化.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/内核参数优化.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/更新时间.txt: -------------------------------------------------------------------------------- 1 | cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2 | 3 | ntpdate time.windows.com 4 | 5 | echo "* 4 * * * /usr/sbin/ntpdate 210.72.145.44 > /dev/null 2>&1" >> /var/spool/cron/root 6 | service crond restart -------------------------------------------------------------------------------- /CentOS/centos6-optimization/添加普通用户并进行sudo授权管理.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/CentOS/centos6-optimization/添加普通用户并进行sudo授权管理.txt -------------------------------------------------------------------------------- /CentOS/centos6-optimization/精简开机自启动服务.txt: -------------------------------------------------------------------------------- 1 | for sun in `chkconfig --list|grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $sun off;done 2 | 3 | for sun in crond rsyslog sshd network iptables;do chkconfig --level 3 $sun on;done 4 | 5 | chkconfig --list|grep 3:on -------------------------------------------------------------------------------- /CentOS/centos6-optimization/设置最大打开文件数.txt: -------------------------------------------------------------------------------- 1 | echo "ulimit -SHn 102400" >> /etc/rc.local 2 | cat >> /etc/security/limits.conf << EOF 3 | * soft nofile 65535 4 | * hard nofile 65535 5 | EOF -------------------------------------------------------------------------------- /Dockerfiles/.gitignore: -------------------------------------------------------------------------------- 1 | # Mac 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /Dockerfiles/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 孤独的√3 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /Dockerfiles/README.md: -------------------------------------------------------------------------------- 1 | ##说明 2 | `debian-jre8` `jre8-tomcat8` `zub-server-610` 3 | 4 | `debian oracle jre8u45 timezone:"Asia/Shanghai" tomcat8.0.23` 5 | 6 | 使用七牛,加速java和tomcat下载, 7 | 8 | ##已推送到官方 9 | ``` 10 | docker pull dreamlu/debian-jre8 11 | 12 | docker pull dreamlu/jre8-tomcat8 13 | ``` 14 | 15 | ##交流QQ群 16 | 如梦技术:`237587118` -------------------------------------------------------------------------------- /Dockerfiles/debian-jre8-weixin/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:jessie-curl 2 | 3 | MAINTAINER Dreamlu 4 | 5 | WORKDIR /tmp 6 | 7 | # Default to UTF-8 file.encoding 8 | ENV LANG C.UTF-8 9 | 10 | ENV MAJOR 8 11 | ENV MINOR 45 12 | ENV JAVA_DEBIAN_VERSION 8u45-b14-2~bpo8+2 13 | 14 | ## timeZone 15 | RUN echo "Asia/Shanghai" > /etc/timezone 16 | RUN dpkg-reconfigure -f noninteractive tzdata 17 | 18 | RUN set -x \ 19 | && curl -fSL http://soft.dreamlu.net/server-jre-${MAJOR}u${MINOR}-linux-x64.tar.gz -o server-jre.tar.gz \ 20 | && mkdir oracle-server-jre \ 21 | && tar -xzf server-jre.tar.gz -C ./oracle-server-jre \ 22 | && mkdir -p /opt/oracle-server-jre \ 23 | && cp -r /tmp/oracle-server-jre/jdk1.${MAJOR}.0_${MINOR}/* /opt/oracle-server-jre/ \ 24 | && ln -s /opt/oracle-server-jre/bin/java /usr/bin/java \ 25 | && chmod ugo+x /usr/bin/java \ 26 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -------------------------------------------------------------------------------- /Dockerfiles/debian-jre8-weixin/README.md: -------------------------------------------------------------------------------- 1 | ## 说明oracle server-jre8u51 2 | 3 | 基于`buildpack-deps:jessie-curl` 4 | 5 | 已替换了lib\security目录下覆盖原来的文件,用于微信消息加解密 6 | 7 | [Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 8](http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html) 8 | 9 | ## build 10 | ``` 11 | docker build -t dreamlu/debian-jre8u51-weixin:latest . 12 | ``` 13 | 14 | ## 直接从dockerhub pull 15 | ``` 16 | docker pull dreamlu/debian-jre8u51-weixin 17 | ``` -------------------------------------------------------------------------------- /Dockerfiles/debian-jre8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM buildpack-deps:jessie-curl 2 | 3 | MAINTAINER Dreamlu 4 | 5 | WORKDIR /tmp 6 | 7 | # Default to UTF-8 file.encoding 8 | ENV LANG C.UTF-8 9 | 10 | ENV MAJOR 8 11 | ENV MINOR 51 12 | ENV JAVA_DEBIAN_VERSION 8u51-b14-2~bpo8+2 13 | 14 | ## timeZone 15 | RUN echo "Asia/Shanghai" > /etc/timezone 16 | RUN dpkg-reconfigure -f noninteractive tzdata 17 | 18 | RUN set -x \ 19 | && curl -fSL http://soft.dreamlu.net/server-jre-${MAJOR}u${MINOR}-linux-weixin-i586.tar.gz -o server-jre.tar.gz \ 20 | && mkdir oracle-server-jre \ 21 | && tar -xzf server-jre.tar.gz -C ./oracle-server-jre \ 22 | && mkdir -p /opt/oracle-server-jre \ 23 | && cp -r /tmp/oracle-server-jre/jdk1.${MAJOR}.0_${MINOR}/* /opt/oracle-server-jre/ \ 24 | && ln -s /opt/oracle-server-jre/bin/java /usr/bin/java \ 25 | && chmod ugo+x /usr/bin/java \ 26 | && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* -------------------------------------------------------------------------------- /Dockerfiles/debian-jre8/README.md: -------------------------------------------------------------------------------- 1 | #说明oracle server-jre8u45 2 | 基于`buildpack-deps:jessie-curl` 3 | 4 | #build 5 | ``` 6 | docker build -t debian-jre8:dreamlu . 7 | ``` -------------------------------------------------------------------------------- /Dockerfiles/jre8-tomcat8-weixin/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM dreamlu/debian-jre8u51-weixin 2 | 3 | ENV CATALINA_HOME /usr/local/tomcat 4 | ENV PATH $CATALINA_HOME/bin:$PATH 5 | RUN mkdir -p "$CATALINA_HOME" 6 | WORKDIR $CATALINA_HOME 7 | 8 | ENV TOMCAT_MAJOR 8 9 | ENV TOMCAT_VERSION 8.0.24 10 | ENV TOMCAT_TGZ_URL http://soft.dreamlu.net/apache-tomcat-"$TOMCAT_VERSION".tar.gz 11 | 12 | RUN set -x \ 13 | && curl -fSL "$TOMCAT_TGZ_URL" -o tomcat.tar.gz \ 14 | && tar -xvf tomcat.tar.gz --strip-components=1 \ 15 | && rm bin/*.bat \ 16 | && rm tomcat.tar.gz 17 | 18 | EXPOSE 8080 19 | CMD ["catalina.sh", "run"] -------------------------------------------------------------------------------- /Dockerfiles/jre8-tomcat8-weixin/README.md: -------------------------------------------------------------------------------- 1 | ## 基于dreamlu/debian-jre8u51-weixin 2 | 3 | ## build 4 | ``` 5 | docker build -t dreamlu/tomcat8-jre8-weixin:latest . 6 | ``` 7 | 8 | ## 从dockerhub pull 9 | ``` 10 | docker pull dreamlu/tomcat8-jre8-weixin 11 | ``` -------------------------------------------------------------------------------- /Dockerfiles/jre8-tomcat8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian-jre8:dreamlu 2 | 3 | ENV CATALINA_HOME /usr/local/tomcat 4 | ENV PATH $CATALINA_HOME/bin:$PATH 5 | RUN mkdir -p "$CATALINA_HOME" 6 | WORKDIR $CATALINA_HOME 7 | 8 | ENV TOMCAT_MAJOR 8 9 | ENV TOMCAT_VERSION 8.0.23 10 | ENV TOMCAT_TGZ_URL http://soft.dreamlu.net/apache-tomcat-"$TOMCAT_VERSION".tar.gz 11 | 12 | RUN set -x \ 13 | && curl -fSL "$TOMCAT_TGZ_URL" -o tomcat.tar.gz \ 14 | && tar -xvf tomcat.tar.gz --strip-components=1 \ 15 | && rm bin/*.bat \ 16 | && rm tomcat.tar.gz 17 | 18 | EXPOSE 8080 19 | CMD ["catalina.sh", "run"] -------------------------------------------------------------------------------- /Dockerfiles/jre8-tomcat8/README.md: -------------------------------------------------------------------------------- 1 | #基于debian-jre8 2 | 3 | #build 4 | ``` 5 | docker build -t tomcat8-jre8:dreamlu . 6 | ``` -------------------------------------------------------------------------------- /Dockerfiles/zub-server-610/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian-jre8:dreamlu 2 | 3 | WORKDIR /usr/local/zbus 4 | 5 | ENV ZBUS_VERSION 6.1.0-SNAPSHOT 6 | ENV ZBUS_JAR_URL http://soft.dreamlu.net/ZbusServer-"$ZBUS_VERSION".jar 7 | 8 | RUN set -x \ 9 | && curl -fSL "$ZBUS_JAR_URL" -o ZbusServer.jar 10 | 11 | EXPOSE 15555 16666 16667 12 | CMD ["java", "-jar", "ZbusServer.jar"] -------------------------------------------------------------------------------- /Dockerfiles/zub-server-610/README.md: -------------------------------------------------------------------------------- 1 | #基于debian-jre8 2 | 3 | #build 4 | ``` 5 | docker build -t zub-server-610:dreamlu . 6 | ``` 7 | 8 | #run 进程守护 9 | ``` 10 | docker run -d -p 15555:15555 zub-server-610:dreamlu 11 | ``` -------------------------------------------------------------------------------- /Docker镜像大礼包/README.md: -------------------------------------------------------------------------------- 1 | docker镜像 2 | 一个拿来即用的docker镜像大礼包 3 | 直接构建dockerfile即可完成镜像。 4 | -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/csphere-elk/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing logstash-forwarder: Dockerfile for building logstash-forwarder images 6 | # 7 | FROM sebp/elk:latest 8 | MAINTAINER Carson,C.J.Zeong 9 | 10 | COPY logstash-forwarder.key /etc/pki/tls/private/logstash-forwarder.key 11 | COPY logstash-forwarder.crt /etc/pki/tls/certs/logstash-forwarder.crt -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/csphere-elk/logstash-forwarder.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBTCCAe2gAwIBAgIJAM8E6mi/ajSdMA0GCSqGSIb3DQEBCwUAMBkxFzAVBgNV 3 | BAMMDmxvZy5jc3BoZXJlLmNuMB4XDTE1MDYyOTA4MTgxN1oXDTE1MDcyOTA4MTgx 4 | N1owGTEXMBUGA1UEAwwObG9nLmNzcGhlcmUuY24wggEiMA0GCSqGSIb3DQEBAQUA 5 | A4IBDwAwggEKAoIBAQC0d5GyhnQ1l5LkX6SvmajTBHP/29eyr6t+sTPo/3LUywpN 6 | 674rRO7bpMSBs3X8FyzDKnJFIyQ4ckFzYqCK5CL3pAfTxN0uE5lQzLM2H/8FjiZL 7 | ghwbYJy1lpjbQI9vFERE2MGVfUSg3A4eFNzMEuA+ckBjwsH0A4Qsbh4fd2jR7KAn 8 | 6vKJk5Z+4OyTnkb4D3eUfH0IYt1WcPLebfeRP3JRUjd/D9bQ2sfdea2rqxBPaPif 9 | rZAeKd+DT1EqlmAQV1h2UVCr4EjkqALLq0X3Lf5C7s8XHPWooVv5smFZzIgR4DSO 10 | qoVqIsMORPuRAKkLg/2IylF0/QhEQvqjByvzBNO5AgMBAAGjUDBOMB0GA1UdDgQW 11 | BBSPkdzAHqcX1vLA/yewCijDe6P7hjAfBgNVHSMEGDAWgBSPkdzAHqcX1vLA/yew 12 | CijDe6P7hjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAfAX+JBuok 13 | KMXi0BlSy6Kdi8DTMeKhr6umRa5uCB7eW9eoX7lCF4V8965MH9fUpEnO2UMTBZds 14 | 0BbFP+wUKaHdCmawJ7tZz7wBZmqH2XxtXyjPNFfqUUAGg3SLTSRCJRpbNy/KUfVB 15 | zrT7u6EdmEdpKpg/aJajfPgRmShO9pwIC0VLgTvdSRrnihDpnX5Gu3CaUUJbh/hW 16 | 12H1McqRqJgYSDxzxCZbjSzSINBUkHipSyUCwCiJJXv4whfIAEDaY8s8tYjIywQ8 17 | 9/Hrq+vQa5AcUnJdqXQWwjaPemak9kuFswBBi+xEvPrlq7ECrsqSjYCINZJagchp 18 | tQuIIXgRv0ee 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/elk-compose.yml: -------------------------------------------------------------------------------- 1 | elk: 2 | image: csphere/elk:1.6.0 3 | environment: 4 | ES_MIX_MEM=64m 5 | ES_MAX_MEM=512m 6 | ports: 7 | - "5000:5000" 8 | - "9200:9200" 9 | - "5601:5601" -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/logstash-forwarder/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing logstash-forwarder: Dockerfile for building logstash-forwarder images 6 | # 7 | FROM csphere/centos:7.1 8 | MAINTAINER Carson,C.J.Zeong 9 | 10 | ENV LOGSTASH_FORWARDER_VERSION 0.4.0-1 11 | ENV LOG_DIR /data/logs 12 | 13 | RUN yum -y install rsyslog && \ 14 | wget -q https://download.elastic.co/logstash-forwarder/binaries/logstash-forwarder-${LOGSTASH_FORWARDER_VERSION}.x86_64.rpm && \ 15 | yum -y localinstall logstash-forwarder-${LOGSTASH_FORWARDER_VERSION}.x86_64.rpm && \ 16 | mkdir -p /data/logs 17 | 18 | COPY logstash-forwarder.conf /etc/logstash-forwarder.conf 19 | COPY logstash-forwarder.crt /etc/pki/tls/certs/logstash-forwarder.crt 20 | COPY supervisor_rsyslog.conf /etc/supervisor.conf.d/rsyslog.conf 21 | COPY supervisor_logstash-forwarder.conf /etc/supervisor.conf.d/logstash-forwarder.conf 22 | 23 | VOLUME ["/data/logs"] 24 | 25 | EXPOSE 514 -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/logstash-forwarder/logstash-forwarder.conf: -------------------------------------------------------------------------------- 1 | { 2 | "network": { 3 | "servers": [ "elk:5000" ], 4 | "timeout": 15, 5 | "ssl ca": "/etc/pki/tls/certs/logstash-forwarder.crt" 6 | }, 7 | "files": [ 8 | { 9 | "paths": [ 10 | "/var/log/syslog", 11 | "/var/log/auth.log" 12 | ], 13 | "fields": { "type": "syslog" } 14 | }, 15 | { 16 | "paths": [ 17 | "/data/logs/access.log" 18 | ], 19 | "fields": { "type": "nginx-access" } 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/logstash-forwarder/logstash-forwarder.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDBTCCAe2gAwIBAgIJAM8E6mi/ajSdMA0GCSqGSIb3DQEBCwUAMBkxFzAVBgNV 3 | BAMMDmxvZy5jc3BoZXJlLmNuMB4XDTE1MDYyOTA4MTgxN1oXDTE1MDcyOTA4MTgx 4 | N1owGTEXMBUGA1UEAwwObG9nLmNzcGhlcmUuY24wggEiMA0GCSqGSIb3DQEBAQUA 5 | A4IBDwAwggEKAoIBAQC0d5GyhnQ1l5LkX6SvmajTBHP/29eyr6t+sTPo/3LUywpN 6 | 674rRO7bpMSBs3X8FyzDKnJFIyQ4ckFzYqCK5CL3pAfTxN0uE5lQzLM2H/8FjiZL 7 | ghwbYJy1lpjbQI9vFERE2MGVfUSg3A4eFNzMEuA+ckBjwsH0A4Qsbh4fd2jR7KAn 8 | 6vKJk5Z+4OyTnkb4D3eUfH0IYt1WcPLebfeRP3JRUjd/D9bQ2sfdea2rqxBPaPif 9 | rZAeKd+DT1EqlmAQV1h2UVCr4EjkqALLq0X3Lf5C7s8XHPWooVv5smFZzIgR4DSO 10 | qoVqIsMORPuRAKkLg/2IylF0/QhEQvqjByvzBNO5AgMBAAGjUDBOMB0GA1UdDgQW 11 | BBSPkdzAHqcX1vLA/yewCijDe6P7hjAfBgNVHSMEGDAWgBSPkdzAHqcX1vLA/yew 12 | CijDe6P7hjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAfAX+JBuok 13 | KMXi0BlSy6Kdi8DTMeKhr6umRa5uCB7eW9eoX7lCF4V8965MH9fUpEnO2UMTBZds 14 | 0BbFP+wUKaHdCmawJ7tZz7wBZmqH2XxtXyjPNFfqUUAGg3SLTSRCJRpbNy/KUfVB 15 | zrT7u6EdmEdpKpg/aJajfPgRmShO9pwIC0VLgTvdSRrnihDpnX5Gu3CaUUJbh/hW 16 | 12H1McqRqJgYSDxzxCZbjSzSINBUkHipSyUCwCiJJXv4whfIAEDaY8s8tYjIywQ8 17 | 9/Hrq+vQa5AcUnJdqXQWwjaPemak9kuFswBBi+xEvPrlq7ECrsqSjYCINZJagchp 18 | tQuIIXgRv0ee 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/logstash-forwarder/supervisor_logstash-forwarder.conf: -------------------------------------------------------------------------------- 1 | [program:logstash-forwarder] 2 | directory=/ 3 | command=/etc/init.d/logstash-forwarder start 4 | user=root 5 | autostart=true 6 | autorestart=true 7 | stdout_logfile=/var/log/supervisor/%(program_name)s.log 8 | stderr_logfile=/var/log/supervisor/%(program_name)s.log -------------------------------------------------------------------------------- /Docker镜像大礼包/elk/logstash-forwarder/supervisor_rsyslog.conf: -------------------------------------------------------------------------------- 1 | [program:rsyslog] 2 | directory=/ 3 | command=/usr/sbin/rsyslogd -f /etc/rsyslog.conf 4 | user=root 5 | autostart=true 6 | autorestart=true 7 | stdout_logfile=/var/log/supervisor/%(program_name)s.log 8 | stderr_logfile=/var/log/supervisor/%(program_name)s.log -------------------------------------------------------------------------------- /Gcc&lib/GCC一键安装新版.md: -------------------------------------------------------------------------------- 1 | # [GCC一键安装新版](https://www.cnblogs.com/longzhu/p/gcc_update.html) 2 | 3 | [![复制代码](https://common.cnblogs.com/images/copycode.gif)](javascript:void(0);) 4 | 5 | ``` 6 | cd /usr/local/src/ 7 | wget http://mirrors-usa.go-parts.com/gcc/releases/gcc-6.2.0/gcc-6.2.0.tar.bz2 8 | wget ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz 9 | wget --no-check-certificate https://gmplib.org/download/gmp/gmp-6.1.1.tar.bz2 10 | wget http://www.mpfr.org/mpfr-current/mpfr-3.1.4.tar.bz2 11 | tar zxf mpc-1.0.3.tar.gz 12 | cd mpc-1.0.3 13 | ./configure --prefix=/usr/local/mpc103 14 | make && make install 15 | cd .. 16 | tar jxf gmp-6.1.1.tar.bz2 17 | cd gmp-6.1.1 18 | ./configure --prefix=/usr/local/gmp611 19 | make && make install 20 | cd .. 21 | tar jxf mpfr-3.1.4.tar.bz2 22 | cd mpfr-3.1.4 23 | ./configure --prefix=/usr/local/mpfr314 --with-gmp=/usr/local/gmp611 24 | make && make install 25 | cd .. 26 | declare -x LD_LIBRARY_PATH=":/usr/local/mpc103/lib:/usr/local/mpfr314/lib:/usr/local/gmp611/lib" 27 | cd cd gcc-6.2.0 28 | ./configure --with-mpc=/usr/local/mpc103 --with-gmp=/usr/local/gmp611 --with-mpfr=/usr/local/mpfr314 --disable-multilib 29 | make && make install 30 | cd .. 31 | tar gcc-6.2.0.tar.bz2 32 | cd gcc-6.2.0./configure --prefix=/usr/local/gcc620 --with-mpc=/usr/local/mpc103 --with-gmp=/usr/local/gmp611 --with-mpfr=/usr/local/mpfr314 --disable-multilibmake && make install 33 | ``` 34 | 35 | [![复制代码](https://common.cnblogs.com/images/copycode.gif)](javascript:void(0);) -------------------------------------------------------------------------------- /Gcc&lib/README.md: -------------------------------------------------------------------------------- 1 | #jun_linux 常用开发环境 2 | 3 | 4 | -------------------------------------------------------------------------------- /JDK/linux下yum安装JDK8.md: -------------------------------------------------------------------------------- 1 | ## linux下yum安装JDK8 2 | 3 | 4 | Linux安装软件方式有很多种,常见的有两种:rpm安装、yum安装。然而人生苦短,我选择yum安装 5 | 6 | 1、先查看centos中自带的jdk并卸载 7 | 8 | 如果从未安装过JDK环境,这一步可忽略 9 | 10 | [root@root ~]# rpm -qa | grep jdk //查看 11 | [root@root ~] rpm -e | grep java //删除 12 | 13 | # 卸载 -e --nodeps 强制删除 14 | [root@kuangshen ~]# rpm -e --nodeps jdk1.8.0_121-1.8.0_121-fcs.x86_64 15 | 16 | 2、yum 命令查找jdk所有版本 17 | 18 | 两种方法: 19 | 20 | //第一种: 21 | [root@root ~]# yum -y list java* 22 | //第二种: 23 | [root@root ~]# yum search jdk 24 | 25 | 3、安装jdk 26 | 27 | 这里以 java-1.8.0-openjdk.x86_64 版本为例 28 | 29 | [root@root ~]# yum install java-1.8.0-openjdk.x86_64 30 | 一直y确定 31 | 32 | 检验安装 33 | [root@root ~]# java -version 34 | 35 | 4、设置jdk环境变量 36 | 37 | [root@root alternatives]# vi /etc/profile 38 | 1 39 | 在文件最后加入如下配置: 40 | 41 | #set java environment 42 | JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.352.b08-2.el7_9.x86_64/jre 43 | PATH=$PATH:$JAVA_HOME/bin 44 | CLASSPATH=.:$JAVA_HOME/lib 45 | export JAVA_HOME CLASSPATH PATH 46 | 47 | 48 | 5、使profile文件立马生效 49 | 50 | [root@root alternatives]#. /etc/profile 51 | 52 | OK,end… 53 | 54 | -------------------------------------------------------------------------------- /Kubernetes-1.12.3-all-auto-install/harbor-install.sh: -------------------------------------------------------------------------------- 1 | # 部署Harbor仓库 2 | # 安装docker-compose 3 | curl -L "https://github.com/docker/compose/releases/download/1.23.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose 4 | chmod +x /usr/local/bin/docker-compose 5 | docker-compose --version 6 | 7 | # 下载harbor企业级Registry仓库 8 | cd ~ 9 | wget https://storage.googleapis.com/harbor-releases/release-1.6.0/harbor-offline-installer-v1.6.3.tgz 10 | tar zxvf harbor-offline-installer-v1.6.3.tgz 11 | cd harbor 12 | 13 | # 修改配置文件的hostname与password 14 | sed -i s/hostname.*/hostname=192.168.119.212/g harbor.cfg 15 | sed -i s/harbor_admin_password.*/harbor_admin_password=admin/g harbor.cfg 16 | 17 | # 将当前仓库添加到docker的配置文件中去 18 | sed -i s/\"insecure-registries\".*/\"insecure-registries\":[\"192.168.119.212\"]/g /etc/docker/daemon.json 19 | systemctl daemon-reload 20 | systemctl restart docker 21 | docker info 22 | 23 | # 开启harbor 24 | ./prepare 25 | ./install.sh 26 | 27 | # 查看启动情况 28 | docker-compose ps -------------------------------------------------------------------------------- /Kubernetes-1.12.3-all-auto-install/kubernetes-dashboard-admin.rbac.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | labels: 6 | k8s-app: kubernetes-dashboard 7 | name: kubernetes-dashboard-admin 8 | namespace: kube-system 9 | --- 10 | apiVersion: rbac.authorization.k8s.io/v1beta1 11 | kind: ClusterRoleBinding 12 | metadata: 13 | labels: 14 | k8s-app: kubernetes-dashboard 15 | name: kubernetes-dashboard-admin 16 | roleRef: 17 | apiGroup: rbac.authorization.k8s.io 18 | kind: ClusterRole 19 | name: cluster-admin 20 | subjects: 21 | - kind: ServiceAccount 22 | name: kubernetes-dashboard-admin 23 | namespace: kube-system 24 | --- -------------------------------------------------------------------------------- /Kubernetes-1.12.3-all-auto-install/nginx-ingress-controller_install.sh: -------------------------------------------------------------------------------- 1 | # 安装nginx-ingress-controller 2 | kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml 3 | kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml -------------------------------------------------------------------------------- /Kubernetes-1.12.3-all-auto-install/node_kubeadm_install.sh: -------------------------------------------------------------------------------- 1 | # 安装k8s-dashboard扩展 2 | kubectl apply -f ~/kubernetes-dashboard.yaml 3 | kubectl apply -f ~/kubernetes-dashboard-admin.rbac.yaml 4 | # 完成后等待pod:dashboard创建启动 5 | # 查看pod状态 6 | kubectl get pods -n kube-system 7 | # 查看service状态 8 | kubectl get service -n kube-system 9 | 10 | #打开浏览器:访问 :https://localhost:30001,使用token登录,token查看方法如下 11 | #kubectl -n kube-system get secret 12 | #kubectl -n kube-system describe secret kubernetes-dashboard-admin-token-skhfh #{上条命令输出的结果中复制的类似kubernetes-dashboard-admin-token-skhfh的key字符串到这里替换} 13 | #复制tokdn数据到登录框内登录即可登录 -------------------------------------------------------------------------------- /NodeJS/npm更换阿里源.md: -------------------------------------------------------------------------------- 1 | # [npm更换阿里源](https://www.cnblogs.com/qiangyuzhou/p/13262075.html) 2 | 3 | ``` 4 | 更新阿里源: 5 | 6 | npm config set registry https://registry.npm.taobao.org/ 7 | ``` 8 | 9 | ------ 10 | 11 | ``` 12 | 检查是否更新成功 13 | npm config get registry 14 | ``` -------------------------------------------------------------------------------- /NodeJS/npm的镜像替换成淘宝.md: -------------------------------------------------------------------------------- 1 | npm的镜像替换成淘宝 2 | 3 | shangrila_kun 2019-04-28 10:45:40 42900 收藏 13 4 | 分类专栏: NPM 文章标签: NPM淘宝镜像 5 | 版权 6 | 7 | NPM 8 | 专栏收录该内容 9 | 1 篇文章0 订阅 10 | 订阅专栏 11 | 在国内直接使用 npm 的官方镜像是非常慢的,这里推荐使用淘宝 NPM 镜像。 12 | 淘宝 NPM 镜像是一个完整 npmjs.org 镜像,你可以用此代替官方版本(只读),同步频率目前为 10分钟 一次以保证尽量与官方服务同步。 13 | 14 | 得到原本的镜像地址 15 | npm get registry 16 | 1 17 | https://registry.npmjs.org/ 18 | 19 | 设成淘宝的 20 | npm config set registry http://registry.npm.taobao.org/ 21 | 22 | yarn config set registry http://registry.npm.taobao.org/ 23 | 1 24 | 2 25 | 3 26 | 换成原来的 27 | npm config set registry https://registry.npmjs.org/ 28 | ———————————————— 29 | 版权声明:本文为CSDN博主「shangrila_kun」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 30 | 原文链接:https://blog.csdn.net/shangrila_kun/article/details/89633374 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jun_linux 常用开发环境及中间件 2 | 3 | ## docker镜像 4 | ### 一个拿来即用的docker镜像大礼包,直接构建docker镜像环境(by docker/dockerfile/k8s/helm/shell and so on )。 -------------------------------------------------------------------------------- /docker-Centos/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:centos7 2 | MAINTAINER chunyuan Zhang 3 | 4 | RUN yum -y install openssh-server epel-release && \ 5 | yum -y install pwgen && \ 6 | rm -f /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_rsa_key && \ 7 | ssh-keygen -q -N "" -t dsa -f /etc/ssh/ssh_host_ecdsa_key && \ 8 | ssh-keygen -q -N "" -t rsa -f /etc/ssh/ssh_host_rsa_key && \ 9 | sed -i "s/#UsePrivilegeSeparation.*/UsePrivilegeSeparation no/g" /etc/ssh/sshd_config 10 | 11 | ADD set_root_pw.sh /set_root_pw.sh 12 | ADD run.sh /run.sh 13 | RUN chmod +x /*.sh 14 | 15 | ENV AUTHORIZED_KEYS **None** 16 | 17 | EXPOSE 22 18 | CMD ["/run.sh"] 19 | -------------------------------------------------------------------------------- /docker-Centos/docker-centos7/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing CentOS7: Dockerfile for building CentOS images 6 | # 7 | FROM docker.io/centos:latest 8 | MAINTAINER MR.NI 9 | 10 | ENV TZ "Asia/Shanghai" 11 | ENV TERM xterm 12 | 13 | ADD aliyun-mirror.repo /etc/yum.repos.d/CentOS-Base.repo 14 | ADD aliyun-epel.repo /etc/yum.repos.d/epel.repo 15 | 16 | RUN yum install -y curl wget tar bzip2 unzip vim-enhanced passwd sudo yum-utils hostname net-tools rsync man && \ 17 | yum install -y gcc gcc-c++ git make automake cmake patch logrotate python-devel libpng-devel libjpeg-devel && \ 18 | yum install -y --enablerepo=epel pwgen python-pip && \ 19 | yum clean all 20 | 21 | RUN pip install supervisor 22 | ADD supervisord.conf /etc/supervisord.conf 23 | 24 | RUN mkdir -p /etc/supervisor.conf.d && \ 25 | mkdir -p /var/log/supervisor 26 | 27 | EXPOSE 22 28 | 29 | ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] 30 | -------------------------------------------------------------------------------- /docker-Centos/docker-centos7/aliyun-epel.repo: -------------------------------------------------------------------------------- 1 | [epel] 2 | name=Extra Packages for Enterprise Linux 7 - $basearch 3 | baseurl=http://mirrors.aliyun.com/epel/7/$basearch 4 | #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch 5 | failovermethod=priority 6 | enabled=1 7 | gpgcheck=0 8 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 9 | 10 | [epel-debuginfo] 11 | name=Extra Packages for Enterprise Linux 7 - $basearch - Debug 12 | baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug 13 | #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch 14 | failovermethod=priority 15 | enabled=0 16 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 17 | gpgcheck=0 18 | 19 | [epel-source] 20 | name=Extra Packages for Enterprise Linux 7 - $basearch - Source 21 | baseurl=http://mirrors.aliyun.com/epel/7/SRPMS 22 | #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch 23 | failovermethod=priority 24 | enabled=0 25 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 26 | gpgcheck=0 -------------------------------------------------------------------------------- /docker-Centos/docker-centos7/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/var/run/supervisor.sock ; (the path to the socket file) 3 | chmod=0700 ; socket file mode (default 0700) 4 | 5 | [supervisord] 6 | logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) 7 | logfile_maxbytes=50MB 8 | logfile_backup=10 9 | loglevel=info 10 | pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 11 | nodaemon=true ; (Start in foreground if true; default false) 12 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 13 | minprocs=200 ; (min. avail process descriptors;default 200) 14 | 15 | [rpcinterface:supervisor] 16 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 17 | 18 | [supervisorctl] 19 | serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket 20 | 21 | [include] 22 | files = /etc/supervisor.conf.d/*.conf -------------------------------------------------------------------------------- /docker-Centos/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "${AUTHORIZED_KEYS}" != "**None**" ]; then 4 | echo "=> Found authorized keys" 5 | mkdir -p /root/.ssh 6 | chmod 700 /root/.ssh 7 | touch /root/.ssh/authorized_keys 8 | chmod 600 /root/.ssh/authorized_keys 9 | IFS=$'\n' 10 | arr=$(echo ${AUTHORIZED_KEYS} | tr "," "\n") 11 | for x in $arr 12 | do 13 | x=$(echo $x |sed -e 's/^ *//' -e 's/ *$//') 14 | cat /root/.ssh/authorized_keys | grep "$x" >/dev/null 2>&1 15 | if [ $? -ne 0 ]; then 16 | echo "=> Adding public key to /root/.ssh/authorized_keys: $x" 17 | echo "$x" >> /root/.ssh/authorized_keys 18 | fi 19 | done 20 | fi 21 | 22 | if [ ! -f /.root_pw_set ]; then 23 | /set_root_pw.sh 24 | fi 25 | exec /usr/sbin/sshd -D 26 | -------------------------------------------------------------------------------- /docker-Centos/set_root_pw.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -f /.root_pw_set ]; then 4 | echo "Root password already set!" 5 | exit 0 6 | fi 7 | 8 | PASS=${ROOT_PASS:-$(pwgen -s 12 1)} 9 | _word=$( [ ${ROOT_PASS} ] && echo "preset" || echo "random" ) 10 | echo "=> Setting a ${_word} password to the root user" 11 | echo "root:$PASS" | chpasswd 12 | 13 | echo "=> Done!" 14 | touch /.root_pw_set 15 | 16 | echo "========================================================================" 17 | echo "You can now connect to this CentOS container via SSH using:" 18 | echo "" 19 | echo " ssh -p root@" 20 | echo "and enter the root password '$PASS' when prompted" 21 | echo "" 22 | echo "Please remember to change the above password as soon as possible!" 23 | echo "========================================================================" 24 | 25 | -------------------------------------------------------------------------------- /docker-Dubbo/README.md: -------------------------------------------------------------------------------- 1 | #jun_linux 常用开发环境 2 | 3 | 4 | -------------------------------------------------------------------------------- /docker-Dubbo/docker安装 dubbo.md: -------------------------------------------------------------------------------- 1 | **docker安装 dubbo** 2 | 3 | 2022-08-14 05:55:10 4 | 5 | # 查看dubbo-admin镜像 6 | 7 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/6a1ff69f31e445e986b20cd02d379968.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5oq56aaZ6bK45LmL5rW3,size_16,color_FFFFFF,t_70,g_se,x_16) 8 | 9 | # 执行拉取指令,默认选择latest版本 10 | 11 | ``` 12 | docker pull chenchuxin/dubbo-admin 13 | ``` 14 | 15 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/c0ff7b010d1c417db8bf2ec8da2cd46b.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5oq56aaZ6bK45LmL5rW3,size_16,color_FFFFFF,t_70,g_se,x_16) 16 | 17 | # 查看下载的镜像 18 | 19 | ``` 20 | docker images 21 | ``` 22 | 23 | # 启动容器 24 | 25 | ``` 26 | docker run -d 27 | --name dubbo-admin 28 | -v /home/keyan/dubbo/dubbo-admin:/data 29 | -p 8180:8080 30 | -e DUBBO_REGISTRY="zookeeper://192.168.8.145:2181" 31 | -e DUBBO_ROOT_PASSWORD=root 32 | -e DUBBO_GUEST_PASSWORD=guest 33 | --restart=always 34 | chenchuxin/dubbo-admin 35 | 36 | 37 | # 注意 -e DUBBO_REGISTRY=zookeeper://ip:port 填写自己的zookeeper ip和端口号 38 | # -e DUBBO_ROOT_PASSWORD 配置控制台root账号 密码 39 | # -e DUBBO_GUEST_PASSWORD 配置控制台guest账号 密码 40 | #-v 是宿主机与容器的挂载目录 41 | #-p 是访问的端口号 42 | ``` 43 | 44 | # 访问 45 | 46 | ![在这里插入图片描述](https://img-blog.csdnimg.cn/e73218171f1549a6983dc60ff4d5d047.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5oq56aaZ6bK45LmL5rW3,size_16,color_FFFFFF,t_70,g_se,x_16) -------------------------------------------------------------------------------- /docker-Gitlab/Gitlab/README.md: -------------------------------------------------------------------------------- 1 | #jun_linux 常用开发环境 2 | 3 | 4 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | .gitignore 3 | LICENSE 4 | VERSION 5 | README.md 6 | Changelog.md 7 | Makefile 8 | docker-compose.yml 9 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/.gitignore: -------------------------------------------------------------------------------- 1 | *.gem 2 | *.tar.gz 3 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/VERSION: -------------------------------------------------------------------------------- 1 | 7.13.2 2 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/assets/config/gitlabhq/database.yml: -------------------------------------------------------------------------------- 1 | production: 2 | adapter: "{{DB_ADAPTER}}" 3 | encoding: "{{DB_ENCODING}}" 4 | collation: "utf8_general_ci" 5 | reconnect: false 6 | database: "{{DB_NAME}}" 7 | host: "{{DB_HOST}}" 8 | port: {{DB_PORT}} 9 | username: "{{DB_USER}}" 10 | password: "{{DB_PASS}}" 11 | pool: {{DB_POOL}} 12 | 13 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/assets/config/gitlabhq/rack_attack.rb: -------------------------------------------------------------------------------- 1 | # 1. Rename this file to rack_attack.rb 2 | # 2. Review the paths_to_be_protected and add any other path you need protecting 3 | # 4 | 5 | paths_to_be_protected = [ 6 | "#{Rails.application.config.relative_url_root}/users/password", 7 | "#{Rails.application.config.relative_url_root}/users/sign_in", 8 | "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session.json", 9 | "#{Rails.application.config.relative_url_root}/api/#{API::API.version}/session", 10 | "#{Rails.application.config.relative_url_root}/users", 11 | "#{Rails.application.config.relative_url_root}/users/confirmation", 12 | "#{Rails.application.config.relative_url_root}/unsubscribes/" 13 | 14 | ] 15 | 16 | # Create one big regular expression that matches strings starting with any of 17 | # the paths_to_be_protected. 18 | paths_regex = Regexp.union(paths_to_be_protected.map { |path| /\A#{Regexp.escape(path)}/ }) 19 | 20 | unless Rails.env.test? 21 | Rack::Attack.throttle('protected paths', limit: 10, period: 60.seconds) do |req| 22 | if req.post? && req.path =~ paths_regex 23 | req.ip 24 | end 25 | end 26 | end 27 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/assets/config/gitlabhq/resque.yml: -------------------------------------------------------------------------------- 1 | # If you change this file in a Merge Request, please also create 2 | # a Merge Request on https://gitlab.com/gitlab-org/omnibus-gitlab/merge_requests 3 | # 4 | development: "redis://{{REDIS_HOST}}:{{REDIS_PORT}}" 5 | test: "redis://{{REDIS_HOST}}:{{REDIS_PORT}}" 6 | production: "redis://{{REDIS_HOST}}:{{REDIS_PORT}}" 7 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/assets/config/gitlabhq/robots.txt: -------------------------------------------------------------------------------- 1 | User-Agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/assets/config/gitlabhq/smtp_settings.rb: -------------------------------------------------------------------------------- 1 | # To enable smtp email delivery for your GitLab instance do next: 2 | # 1. Rename this file to smtp_settings.rb 3 | # 2. Edit settings inside this file 4 | # 3. Restart GitLab instance 5 | # 6 | if Rails.env.production? 7 | Gitlab::Application.config.action_mailer.delivery_method = :smtp 8 | 9 | ActionMailer::Base.smtp_settings = { 10 | address: "{{SMTP_HOST}}", 11 | port: {{SMTP_PORT}}, 12 | user_name: "{{SMTP_USER}}", 13 | password: "{{SMTP_PASS}}", 14 | domain: "{{SMTP_DOMAIN}}", 15 | authentication: "{{SMTP_AUTHENTICATION}}", 16 | openssl_verify_mode: "{{SMTP_OPENSSL_VERIFY_MODE}}", 17 | enable_starttls_auto: {{SMTP_STARTTLS}}, 18 | tls: {{SMTP_TLS}} 19 | } 20 | end 21 | -------------------------------------------------------------------------------- /docker-Gitlab/docker-gitlab-zh/docker-compose.yml: -------------------------------------------------------------------------------- 1 | postgresql: 2 | image: sameersbn/postgresql:9.4-2 3 | environment: 4 | - DB_USER=gitlab 5 | - DB_PASS=password 6 | - DB_NAME=gitlabhq_production 7 | volumes: 8 | - /srv/docker/gitlab/postgresql:/var/lib/postgresql 9 | gitlab: 10 | image: sameersbn/gitlab:7.13.2 11 | links: 12 | - redis:redisio 13 | - postgresql:postgresql 14 | ports: 15 | - "10080:80" 16 | - "10022:22" 17 | environment: 18 | - TZ=Asia/Kolkata 19 | - SMTP_ENABLED=false 20 | - SMTP_DOMAIN=www.example.com 21 | - SMTP_HOST=smtp.gmail.com 22 | - SMTP_PORT=587 23 | - SMTP_USER=mailer@example.com 24 | - SMTP_PASS=password 25 | - SMTP_STARTTLS=true 26 | - SMTP_AUTHENTICATION=login 27 | - GITLAB_TIMEZONE=Kolkata 28 | - GITLAB_HOST=localhost 29 | - GITLAB_PORT=10080 30 | - GITLAB_SSH_PORT=10022 31 | - GITLAB_EMAIL=admin@example.com 32 | - GITLAB_EMAIL_REPLY_TO=noreply@example.com 33 | - GITLAB_BACKUPS=daily 34 | - GITLAB_BACKUP_TIME=01:00 35 | volumes: 36 | - /srv/docker/gitlab/gitlab:/home/git/data 37 | redis: 38 | image: sameersbn/redis:latest 39 | volumes: 40 | - /srv/docker/gitlab/redis:/var/lib/redis 41 | -------------------------------------------------------------------------------- /docker-Gitlab/rebuild master.md: -------------------------------------------------------------------------------- 1 | 有些时候,git 仓库累积了太多无用的历史更改,导致 clone 文件过大。如果确定历史更改没有意义,可以采用下述方法清空历史, 2 | 3 | 4 | git checkout --orphan latest_branch2 5 | git add -A 6 | git commit -am "commit message" 7 | git branch -D master 8 | git branch -m master 9 | git push -f origin master 10 | 11 | 12 | http://hub.fastgit.org 13 | 14 | 1) 先 clone 项目到本地目录 (以名为 mylearning 的仓库为例) 15 | 16 | $ git clone git@gitee.com:badboycoming/mylearning.git 17 | 18 | 19 | 2) 进入 mylearning 仓库,拉一个分支,比如名为 latest_branch 20 | 21 | $ git checkout --orphan latest_branch 22 | 23 | 24 | 3) 添加所有文件到上述分支 (Optional) 25 | 26 | $ git add -A 27 | 28 | 29 | 4) 提交一次 30 | 31 | $ git commit -am "Initial commit." 32 | 33 | 34 | 5) 删除 master 分支 35 | 36 | $ git branch -D master 37 | 38 | 39 | 6) 更改当前分支为 master 分支 40 | 41 | $ git branch -m master 42 | 43 | 44 | 7) 将本地所有更改 push 到远程仓库 45 | 46 | $ git push -f origin master 47 | 48 | 49 | 8) 关联本地 master 到远程 master 50 | 51 | $ git branch --set-upstream-to=origin/master 52 | 53 | 54 | 注意:对 gitee 用户,因为 gitee 目前限制单个仓库大小为 1024 MB,清除完历史记录后,还要去项目主页 Settings 下做一下 Git GC. 55 | 56 | 完。 -------------------------------------------------------------------------------- /docker-Gitlab/重置master分支.md: -------------------------------------------------------------------------------- 1 | 重置master分支: 2 | git checkout --orphan latest_branch 3 | git add -A 4 | git commit -am "commit message" 5 | git branch -D master 6 | git branch -m master 7 | 8 | 9 | git branch -m latest_branch master 10 | git push -f origin master 11 | git push origin latest_branch:master -f 12 | git reset --hard origin/master 13 | 14 | 15 | 有时候我们项目中会配置很多内容,在新起一个项目的时候,重新从头配置比较浪费时间,但是直接将原来项目拿来修改远程地址后,项目里还会保存之前的提交历史和tag;这个时候我们就需要下面的操作来清空这些内容。 16 | 17 | 1.创建新分支(这个命名是基于当前所在分支新建一个赤裸裸的分支,没有任何的提交历史,但是当前分支的内容一应俱全。新建的分支,严格意义上说,还不是一个分支,因为HEAD指向的引用中没有commit值,只有在进行一次提交后,它才算得上真正的分支。) 18 | 19 | git checkout --orphan latest_branch 20 | 21 | 2.添加所有文件 22 | 23 | git add . 24 | 25 | 3.commit代码 26 | 27 | git commit -m "xxx" 28 | 29 | 4.删除原来的master分支 30 | 31 | git branch -D master 32 | git branch -D main 33 | 34 | 5.把当前分支重命名为master 35 | 36 | git branch -m master 37 | git branch -m main 38 | 39 | 6.最后把代码推送到远程仓库(有些仓库有master分支保护,不允许强制push,需要在远程仓库项目里暂时把项目保护关掉才能推送) 40 | 41 | git push -f origin master 42 | git push -f origin main 43 | 44 | -------------------------------------------------------------------------------- /docker-Jenkins/README.md: -------------------------------------------------------------------------------- 1 | #jun_linux 常用开发环境 2 | 3 | 4 | -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins-v2/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing Jenkins: Dockerfile for building Jenkins images 6 | # 7 | FROM aft/jdk:1.7 8 | MAINTAINER ME.NI 9 | 10 | ENV JENKINS_HOME /var/jenkins_home 11 | ENV JENKINS_VERSION 1.609.1 12 | ENV JENKINS_UC https://updates.jenkins-ci.org 13 | ENV COPY_REFERENCE_FILE_LOG /var/log/copy_reference_file.log 14 | 15 | RUN useradd -d "$JENKINS_HOME" -u 1000 -m -s /bin/bash jenkins 16 | 17 | RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d 18 | 19 | COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy 20 | 21 | RUN curl -fL http://mirrors.jenkins-ci.org/war-stable/1.609.1/jenkins.war -o /usr/share/jenkins/jenkins.war && \ 22 | chown -R jenkins "$JENKINS_HOME" /usr/share/jenkins/ref && \ 23 | touch $COPY_REFERENCE_FILE_LOG && chown jenkins.jenkins $COPY_REFERENCE_FILE_LOG 24 | 25 | USER jenkins 26 | 27 | VOLUME /var/jenkins_home 28 | 29 | EXPOSE 8080 50000 30 | 31 | COPY jenkins.sh /usr/local/bin/jenkins.sh 32 | 33 | ENTRYPOINT ["/usr/local/bin/jenkins.sh"] 34 | -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins/Dockerfile: -------------------------------------------------------------------------------- 1 | # 基于jenkins:1.609.1官方镜像 2 | FROM jenkins:1.609.1 3 | 4 | USER root 5 | # 安装sudo 6 | RUN apt-get update \ 7 | && apt-get install -y sudo \ 8 | && rm -rf /var/lib/apt/lists/* 9 | # 给jenkins用户赋予sudo权限 10 | RUN echo "jenkins ALL=NOPASSWD: ALL" >> /etc/sudoers 11 | 12 | USER jenkins 13 | # plugins.txt 拷贝 14 | COPY plugins.txt /usr/share/jenkins/plugins.txt 15 | # 下载相应的插件,/usr/local/bin/plugins.sh可以参加jenkins官方镜像源码https://github.com/jenkinsci/docker 16 | RUN /usr/local/bin/plugins.sh /usr/share/jenkins/plugins.txt 17 | -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins/README.md: -------------------------------------------------------------------------------- 1 | # docker-jenkins 2 | running docker in jenkins in docker,在(Docker里的)Jenkins里运行Docker 3 | 4 | ##使用## 5 | ####1、从Github拉取源码#### 6 | git clone https://github.com/donhui/docker-jenkins.git 7 | ####2、构建镜像#### 8 | docker build -t myname/jenkins:1.609.1 docker-jenkins/Dockerfile 9 | ####3、基于镜像运行容器(注意把docker.sock和docker映射到jenkins容器里)#### 10 | docker run -d --name myjenkins -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/usr/bin/docker -p 8080:8080 myname/jenkins:1.609.1 11 | ####4、Jenkins创建JOB,构建步骤选择Execute shell,内容为:sudo docker images,构建后日志输出如下:#### 12 | ![consoleoutput](consoleoutput.png) 13 | 14 | ##refer## 15 | - [jenkins官方镜像](https://github.com/jenkinsci/docker) 16 | - [running-docker-in-jenkins-in-docker](http://container-solutions.com/running-docker-in-jenkins-in-docker/) 17 | - [running-docker-in-jenkins-in-docker中文翻译版](http://www.dockone.io/article/431) 18 | -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins/consoleoutput.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-Jenkins/docker-jenkins/consoleoutput.png -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins/init.groovy: -------------------------------------------------------------------------------- 1 | import hudson.model.*; 2 | import jenkins.model.*; 3 | 4 | 5 | Thread.start { 6 | sleep 10000 7 | println "--> setting agent port for jnlp" 8 | Jenkins.instance.setSlaveAgentPort(50000) 9 | } -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins/jenkins.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | 5 | # Copy files from /usr/share/jenkins/ref into /var/jenkins_home 6 | # So the initial JENKINS-HOME is set with expected content. 7 | # Don't override, as this is just a reference setup, and use from UI 8 | # can then change this, upgrade plugins, etc. 9 | copy_reference_file() { 10 | f=${1%/} 11 | echo "$f" >> $COPY_REFERENCE_FILE_LOG 12 | rel=${f:23} 13 | dir=$(dirname ${f}) 14 | echo " $f -> $rel" >> $COPY_REFERENCE_FILE_LOG 15 | if [[ ! -e /var/jenkins_home/${rel} ]] 16 | then 17 | echo "copy $rel to JENKINS_HOME" >> $COPY_REFERENCE_FILE_LOG 18 | mkdir -p /var/jenkins_home/${dir:23} 19 | cp -r /usr/share/jenkins/ref/${rel} /var/jenkins_home/${rel}; 20 | # pin plugins on initial copy 21 | [[ ${rel} == plugins/*.jpi ]] && touch /var/jenkins_home/${rel}.pinned 22 | fi; 23 | } 24 | export -f copy_reference_file 25 | echo "--- Copying files at $(date)" >> $COPY_REFERENCE_FILE_LOG 26 | find /usr/share/jenkins/ref/ -type f -exec bash -c 'copy_reference_file {}' \; 27 | 28 | # if `docker run` first argument start with `--` the user is passing jenkins launcher arguments 29 | if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then 30 | exec java $JAVA_OPTS -jar /usr/share/jenkins/jenkins.war $JENKINS_OPTS "$@" 31 | fi 32 | 33 | # As argument is not jenkins, assume user want to run his own process, for sample a `bash` shell to explore this image 34 | exec "$@" -------------------------------------------------------------------------------- /docker-Jenkins/docker-jenkins/plugins.txt: -------------------------------------------------------------------------------- 1 | authentication-tokens:latest 2 | scm-api:latest 3 | git-client:latest 4 | git:latest 5 | docker-commons:latest 6 | docker-build-step:latest 7 | -------------------------------------------------------------------------------- /docker-Jenkins/jenkins-前端shell脚本: -------------------------------------------------------------------------------- 1 | npm install 2 | npm run build 3 | DIST_DIR=/bshf/programe/clinic/dist 4 | BAK_DIR=/bshf/bak/fe-clinic 5 | if [ -d "$DIST_DIR" ]; then 6 | mv $DIST_DIR $BAK_DIR/dist-$(date +%Y%m%d) 7 | echo "=====copy done=====" 8 | fi 9 | rm -rf $DIST_DIR 10 | mv /root/.jenkins/jobs/fe-clinic/workspace/dist /bshf/programe/clinic -------------------------------------------------------------------------------- /docker-Jenkins/jenkins-后端shell脚本: -------------------------------------------------------------------------------- 1 | export BUILD_ID=bshf 2 | BAK_DIR=/bshf/bak/manage 3 | TOMCAT_NAME=tomcat-8.0.43_manage 4 | TOMCAT_DIR=/bshf/devTools/$TOMCAT_NAME 5 | SERVICE_PACKAGE=manage 6 | SERVICE_NAME=$SERVICE_PACKAGE\.war 7 | JENKINS_PATH=/root/.jenkins/jobs/rd-manage/workspace/manage-web/target 8 | MY_FILE=$TOMCAT_DIR/webapps/$SERVICE_NAME 9 | 10 | P_ID=`ps -ef|grep tomcat-8.0.43_manage/bin/bootstrap.jar | grep java | awk '{print $2}'` 11 | if [ -f "$MY_FILE" ]; then 12 | mv $MY_FILE $BAK_DIR/$SERVICE_NAME.$(date +%Y%m%d) 13 | echo "=====copy done=====" 14 | fi 15 | mv $JENKINS_PATH/$SERVICE_NAME $TOMCAT_DIR/webapps 16 | if [ "$P_ID" != "" ]; then 17 | kill -9 $P_ID 18 | echo "============kill done=============" 19 | fi 20 | sleep 3 21 | rm -rf $TOMCAT_DIR/webapps/$SERVICE_PACKAGE 22 | sh $TOMCAT_DIR/bin/startup.sh -------------------------------------------------------------------------------- /docker-Maven/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 |
Java configuration with XML SchemaMarcelloVitaletti
-------------------------------------------------------------------------------- /docker-Maven/docker-maven/.gitignore: -------------------------------------------------------------------------------- 1 | apache-maven-3.3.3-bin.tar.gz -------------------------------------------------------------------------------- /docker-Maven/docker-maven/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing maven: Dockerfile for building maven images 6 | # 7 | FROM aft/jdk:1.7 8 | MAINTAINER MR.NI 9 | 10 | ENV MAVEN_VERSION 3.3.3 11 | ENV MAVEN_HOME /opt/maven 12 | 13 | # Install maven 14 | RUN curl -fsSL http://mirror.cc.columbia.edu/pub/software/apache/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz 15 | 16 | #COPY apache-maven-3.3.3-bin.tar.gz /opt/ 17 | 18 | RUN tar xzf /opt/apache-maven-3.3.3-bin.tar.gz -C /opt && \ 19 | mv /opt/apache-maven-${MAVEN_VERSION} /opt/maven && \ 20 | ln -s /opt/maven/bin/mvn /usr/bin/mvn 21 | 22 | COPY settings.xml /opt/maven/conf/settings.xml 23 | 24 | ADD hello /hello 25 | RUN cd /hello && \ 26 | mvn clean install -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true 27 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/.mymetadata: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/java/csphere/xc/dao/user_select.java: -------------------------------------------------------------------------------- 1 | package csphere.xc.dao; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | 6 | import org.apache.ibatis.io.Resources; 7 | import org.apache.ibatis.session.SqlSession; 8 | import org.apache.ibatis.session.SqlSessionFactory; 9 | import org.apache.ibatis.session.SqlSessionFactoryBuilder; 10 | 11 | import csphere.xc.po.User; 12 | 13 | 14 | 15 | public class user_select { 16 | 17 | 18 | public static String select()throws IOException { 19 | String resource = "sqlMapConfig.xml"; 20 | 21 | InputStream inputStream = Resources.getResourceAsStream(resource); 22 | 23 | 24 | SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream); 25 | 26 | SqlSession sqlSession = sqlSessionFactory.openSession(); 27 | 28 | 29 | User user = sqlSession.selectOne("csphere.xc.findUserById", 1); 30 | 31 | System.err.println("haha-----------------"+user.getName()); 32 | 33 | sqlSession.close(); 34 | return user.getName(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/java/csphere/xc/po/User.java: -------------------------------------------------------------------------------- 1 | package csphere.xc.po; 2 | 3 | public class User { 4 | 5 | private int id; 6 | private String name; 7 | public int getId() { 8 | return id; 9 | } 10 | public void setId(int id) { 11 | this.id = id; 12 | } 13 | public String getName() { 14 | return name; 15 | } 16 | public void setName(String name) { 17 | this.name = name; 18 | } 19 | @Override 20 | public String toString() { 21 | return "User [id=" + id + ", name=" + name + "]"; 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/java/csphere/xc/po/User.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/java/log4j.properties: -------------------------------------------------------------------------------- 1 | # Global logging configuration 2 | log4j.rootLogger=DEBUG, stdout 3 | # Console output... 4 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 5 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 6 | log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n 7 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/java/sqlMapConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: 3 | 4 | -------------------------------------------------------------------------------- /docker-Maven/docker-maven/hello/src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@page import="csphere.xc.dao.user_select"%> 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <% 5 | user_select select = new user_select(); 6 | String name1 = select.select(); 7 | request.setAttribute("name", name1); 8 | %> 9 | 10 | 11 |

Hello <%=name1 %> !

12 | 13 | 14 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql-v2/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER chunyuan Zhang 3 | 4 | # Add MySQL configuration 5 | COPY my.cnf /etc/mysql/conf.d/my.cnf 6 | COPY mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf 7 | 8 | RUN apt-get update && \ 9 | apt-get -yq install mysql-server-5.6 pwgen && \ 10 | rm -rf /var/lib/apt/lists/* && \ 11 | rm /etc/mysql/conf.d/mysqld_safe_syslog.cnf && \ 12 | if [ ! -f /usr/share/mysql/my-default.cnf ] ; then cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf; fi && \ 13 | mysql_install_db > /dev/null 2>&1 && \ 14 | touch /var/lib/mysql/.EMPTY_DB 15 | 16 | # Add MySQL scripts 17 | COPY import_sql.sh /import_sql.sh 18 | COPY run.sh /run.sh 19 | 20 | ENV MYSQL_USER=admin \ 21 | MYSQL_PASS=**Random** \ 22 | ON_CREATE_DB=**False** \ 23 | REPLICATION_MASTER=**False** \ 24 | REPLICATION_SLAVE=**False** \ 25 | REPLICATION_USER=replica \ 26 | REPLICATION_PASS=replica 27 | 28 | # Add VOLUMEs to allow backup of config and databases 29 | VOLUME ["/etc/mysql", "/var/lib/mysql"] 30 | 31 | # EXPOSE 3306 32 | CMD ["/run.sh"] 33 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql-v2/mysqld_charset.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character_set_server=utf8 3 | character_set_filesystem=utf8 4 | collation-server=utf8_general_ci 5 | init-connect='SET NAMES utf8' 6 | init_connect='SET collation_connection = utf8_general_ci' 7 | skip-character-set-client-handshake 8 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing Mariadb: Dockerfile for building Mariadb images 6 | # 7 | FROM aft/centos:7.0 8 | MAINTAINER MR.NI 9 | 10 | ENV DATA_DIR /var/lib/mysql 11 | 12 | # Install Mariadb 13 | RUN yum install -y mariadb mariadb-server && \ 14 | yum clean all 15 | 16 | ADD mysqld_charset.cnf /etc/my.cnf.d/ 17 | 18 | COPY scripts /scripts 19 | RUN chmod +x /scripts/start 20 | 21 | EXPOSE 3306 22 | 23 | VOLUME ["/var/lib/mysql"] 24 | 25 | ENTRYPOINT ["/scripts/start"] 26 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/build-imysql-v2/README.md: -------------------------------------------------------------------------------- 1 | # build-imysql 2 | github build mysql 主从模式images 3 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/import_sql.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 3 ]]; then 4 | echo "Usage: $0 " 5 | exit 1 6 | fi 7 | 8 | echo "=> Starting MySQL Server" 9 | /usr/bin/mysqld_safe > /dev/null 2>&1 & 10 | PID=$! 11 | 12 | RET=1 13 | while [[ $RET -ne 0 ]]; do 14 | echo "=> Waiting for confirmation of MySQL service startup" 15 | sleep 5 16 | mysql -u"$1" -p"$2" -e "status" > /dev/null 2>&1 17 | RET=$? 18 | done 19 | 20 | echo " Started with PID ${PID}" 21 | 22 | echo "=> Importing SQL file" 23 | mysql -u"$1" -p"$2" < "$3" 24 | 25 | echo "=> Stopping MySQL Server" 26 | mysqladmin -u"$1" -p"$2" shutdown 27 | 28 | echo "=> Done!" 29 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/my.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | bind-address=0.0.0.0 3 | # http://www.percona.com/blog/2008/05/31/dns-achilles-heel-mysql-installation/ 4 | skip_name_resolve 5 | #server-id 6 | #log-bin 7 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/mysqld_charset.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | character_set_server=utf8 3 | character_set_filesystem=utf8 4 | collation-server=utf8_general_ci 5 | init-connect='SET NAMES utf8' 6 | init_connect='SET collation_connection = utf8_general_ci' 7 | skip-character-set-client-handshake -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/scripts/firstrun: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-Mysql/docker-mysql/scripts/firstrun -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/scripts/firstrun_maria: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DB_USER=${DB_USER:-root} 4 | DB_PASS=${DB_PASS:-1234} 5 | 6 | MARIADB_NEW=true 7 | 8 | # 9 | # MariaDB setup 10 | # 11 | firstrun_maria() { 12 | 13 | # First install mariadb 14 | if [[ ! -d ${DATA_DIR}/mysql ]]; then 15 | echo "===> MariaDB not install..." 16 | 17 | echo "===> Initializing maria database... " 18 | mysql_install_db --user=mysql --ldata=${DATA_DIR} 19 | echo "===> System databases initialized..." 20 | 21 | # Start mariadb 22 | /usr/bin/mysqld_safe --user mysql > /dev/null 2>&1 & 23 | 24 | echo "===> Waiting for MariaDB to start..." 25 | 26 | STA=1 27 | while [[ STA -ne 0 ]]; do 28 | printf "." 29 | sleep 5 30 | mysql -uroot -e "status" > /dev/null 2>&1 31 | STA=$? 32 | done 33 | echo "===> Start OK..." 34 | 35 | # 1. UPDATE MYSQL ROOT PASSWORD 36 | mysql -u root -e "UPDATE mysql.USER SET password='$DB_PASS' WHERE USER='$DB_USER'" 37 | mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' IDENTIFIED BY '$DB_PASS' WITH GRANT OPTION;" 38 | echo "===> update root pass localhost completed..." 39 | 40 | # shutdown mariadb to wait for supervisor 41 | mysqladmin -u root shutdown 42 | 43 | else 44 | if [[ -e ${DATA_DIR}/mysql.sock ]]; then 45 | rm -f ${DATA_DIR}/mysql.sock 46 | fi 47 | 48 | MARIADB_NEW=false 49 | 50 | echo "===> Using an existing volume of MariaDB" 51 | fi 52 | } 53 | 54 | firstrun_maria 55 | -------------------------------------------------------------------------------- /docker-Mysql/docker-mysql/scripts/start: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # 6 | # When Startup Container script 7 | # 8 | 9 | if [[ -e /scripts/firstrun ]]; then 10 | # config mariadb 11 | /scripts/firstrun_maria 12 | rm /scripts/firstrun 13 | else 14 | # Cleanup previous mariadb sockets 15 | if [[ -e ${DATA_DIR}/mysql.sock ]]; then 16 | rm -f ${DATA_DIR}/mysql.sock 17 | fi 18 | fi 19 | 20 | exec /usr/bin/mysqld_safe 21 | 22 | -------------------------------------------------------------------------------- /docker-PostgreSQL/PostgreSQL用户说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-PostgreSQL/PostgreSQL用户说明.txt -------------------------------------------------------------------------------- /docker-Redis/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:centos6 2 | MAINTAINER qm 3 | 4 | RUN yum update -y 5 | 6 | # install redis 7 | RUN yum install -y curl tar make gcc && \ 8 | cd /usr/local/src && \ 9 | curl -O http://download.redis.io/releases/redis-2.8.9.tar.gz && \ 10 | tar xf redis-2.8.9.tar.gz && \ 11 | cd redis-2.8.9 && \ 12 | make && \ 13 | make install 14 | 15 | EXPOSE 6379 16 | CMD ["/usr/local/bin/redis-server"] -------------------------------------------------------------------------------- /docker-Redis/README.md: -------------------------------------------------------------------------------- 1 | #docker-redis 2 | 3 | docker pull redis:6.2.6 4 | 5 | docker run -p 6379:6379 --name redis666 -v /home/redis/conf/redis.conf:/etc/redis/redis.conf -v /home/redis/data:/data -d redis:6.2.6 redis-server /etc/redis/redis.conf --appendonly yes 6 | 7 | docker run -itd --name redis-7 -p 6379:6379 redis:6.0 8 | docker run -itd --name redis-test -p 6379:6379 redis 9 | docker exec -it redis-test /bin/bash 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /docker-SSDB/docker部署ssdb.md: -------------------------------------------------------------------------------- 1 | docker部署ssdb 2 | 3 | 4 | 1、下载centos镜像,版本按需下载 5 | 6 | docker pull centos:7.7.1908 7 | 8 | 2、查看镜像 9 | 10 | docker images 11 | 12 | 3、用镜像创建容器 13 | 14 | 注意端口映射主机6381对应容器ssdb默认端口8888,/bin/bash设置的是启动命令,可以直接设置为ssdb启动命令 15 | 16 | docker run -p 6381:8888 --name ssdbServer -dit centos:7.7.1908 /bin/bash 17 | 18 | 创建完成使用docker ps 19 | 20 | 4、 21 | 22 | 启动:docker start ssdbServer 23 | 24 | 进入:docker exec -it ssdbServer /bin/bash 25 | 26 | 5、编译和安装http://ideawu.github.io/ssdb-docs/install.html 27 | 28 | wget --no-check-certificate https://github.com/ideawu/ssdb/archive/master.zip 29 | unzip master 30 | cd ssdb-master 31 | make 32 | make install 33 | 6、如果缺少组件按照提示使用yum命令安装,如果已有autoconf,还提示安装autoconf, 其实是没有装which,使用命令 34 | 35 | yum install -y which 之后再编译 36 | 37 | 7、 38 | 39 | (1)启动服务, 此命令会阻塞住命令行 40 | 41 | ./ssdb-server ssdb.conf 42 | 43 | 或者启动为后台进程(不阻塞命令行) 44 | 45 | ./ssdb-server -d ssdb.conf 46 | 47 | (2)客户端启动 ssdb 命令行 48 | 49 | ./tools/ssdb-cli -p 8888 50 | 51 | (3)停止服务 ssdb-server 52 | 53 | ./ssdb-server ssdb.conf -s stop 54 | 55 | 8、ssdb.conf文件默认只能本机访问,远程访问修改ip为0.0.0.0,需要密码设置auth项 56 | 57 | 58 | 59 | 9、连接测试 60 | 61 | 62 | 63 | 10、语法:http://ssdb.io/ssdb-get-started.pdf,要用迅雷才能下,很奇怪 64 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/.gitignore: -------------------------------------------------------------------------------- 1 | *.tar.gz 2 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tifayuki/java:7 2 | MAINTAINER cy zhang 3 | 4 | RUN apt-get update && \ 5 | apt-get install -yq --no-install-recommends wget pwgen ca-certificates && \ 6 | apt-get clean && \ 7 | rm -rf /var/lib/apt/lists/* 8 | 9 | ENV TOMCAT_MAJOR_VERSION 7 10 | ENV TOMCAT_MINOR_VERSION 7.0.55 11 | ENV CATALINA_HOME /tomcat 12 | 13 | # INSTALL TOMCAT 14 | RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz && \ 15 | wget -qO- https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz.md5 | md5sum -c - && \ 16 | tar zxf apache-tomcat-*.tar.gz && \ 17 | rm apache-tomcat-*.tar.gz && \ 18 | mv apache-tomcat* tomcat 19 | 20 | ADD create_tomcat_admin_user.sh /create_tomcat_admin_user.sh 21 | ADD run.sh /run.sh 22 | RUN chmod +x /*.sh 23 | 24 | #EXPOSE 8080 25 | CMD ["/run.sh"] 26 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/7.0/create_tomcat_admin_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -f /.tomcat_admin_created ]; then 4 | echo "Tomcat 'admin' user already created" 5 | exit 0 6 | fi 7 | 8 | #generate password 9 | PASS=${TOMCAT_PASS:-$(pwgen -s 12 1)} 10 | _word=$( [ ${TOMCAT_PASS} ] && echo "preset" || echo "random" ) 11 | 12 | echo "=> Creating an admin user with a ${_word} password in Tomcat" 13 | sed -i -r 's/<\/tomcat-users>//' ${CATALINA_HOME}/conf/tomcat-users.xml 14 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 15 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 16 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 17 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 18 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 19 | echo "" >> ${CATALINA_HOME}/conf/tomcat-users.xml 20 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 21 | echo "=> Done!" 22 | touch /.tomcat_admin_created 23 | 24 | echo "========================================================================" 25 | echo "You can now configure to this Tomcat server using:" 26 | echo "" 27 | echo " admin:${PASS}" 28 | echo "" 29 | echo "========================================================================" 30 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/7.0/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f /.tomcat_admin_created ]; then 4 | /create_tomcat_admin_user.sh 5 | fi 6 | 7 | exec ${CATALINA_HOME}/bin/catalina.sh run 8 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tifayuki/java:7 2 | MAINTAINER cy zhang 3 | 4 | RUN apt-get update && \ 5 | apt-get install -yq --no-install-recommends wget pwgen ca-certificates && \ 6 | apt-get clean && \ 7 | rm -rf /var/lib/apt/lists/* 8 | 9 | ENV TOMCAT_MAJOR_VERSION 8 10 | ENV TOMCAT_MINOR_VERSION 8.0.11 11 | ENV CATALINA_HOME /tomcat 12 | 13 | # INSTALL TOMCAT 14 | RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz && \ 15 | wget -qO- https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz.md5 | md5sum -c - && \ 16 | tar zxf apache-tomcat-*.tar.gz && \ 17 | rm apache-tomcat-*.tar.gz && \ 18 | mv apache-tomcat* tomcat 19 | 20 | ADD create_tomcat_admin_user.sh /create_tomcat_admin_user.sh 21 | ADD run.sh /run.sh 22 | RUN chmod +x /*.sh 23 | 24 | #EXPOSE 8080 25 | CMD ["/run.sh"] 26 | 27 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/8.0/create_tomcat_admin_user.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -f /.tomcat_admin_created ]; then 4 | echo "Tomcat 'admin' user already created" 5 | exit 0 6 | fi 7 | 8 | #generate password 9 | PASS=${TOMCAT_PASS:-$(pwgen -s 12 1)} 10 | _word=$( [ ${TOMCAT_PASS} ] && echo "preset" || echo "random" ) 11 | 12 | echo "=> Creating an admin user with a ${_word} password in Tomcat" 13 | sed -i -r 's/<\/tomcat-users>//' ${CATALINA_HOME}/conf/tomcat-users.xml 14 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 15 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 16 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 17 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 18 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 19 | echo "" >> ${CATALINA_HOME}/conf/tomcat-users.xml 20 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 21 | echo "=> Done!" 22 | touch /.tomcat_admin_created 23 | 24 | echo "========================================================================" 25 | echo "You can now configure to this Tomcat server using:" 26 | echo "" 27 | echo " admin:${PASS}" 28 | echo "" 29 | echo "========================================================================" 30 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/8.0/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -f /.tomcat_admin_created ]; then 4 | /create_tomcat_admin_user.sh 5 | fi 6 | 7 | exec ${CATALINA_HOME}/bin/catalina.sh run 8 | 9 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing TOMCAT: Dockerfile for building TOMCAT images 6 | # 7 | FROM aft/jdk:1.7 8 | MAINTAINER MR.NI 9 | 10 | ENV TOMCAT_MAJOR_VERSION 7 11 | ENV TOMCAT_MINOR_VERSION 7.0.55 12 | ENV CATALINA_HOME /tomcat 13 | ENV APP_DIR ${CATALINA_HOME}/webapps/ 14 | 15 | # Install tomcat 16 | # RUN wget -q https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz 17 | 18 | COPY apache-tomcat-7.0.64.tar.gz apache-tomcat-7.0.64.tar.gz 19 | 20 | RUN tar zxf apache-tomcat-*.tar.gz && \ 21 | rm apache-tomcat-*.tar.gz && \ 22 | mv apache-tomcat* tomcat 23 | 24 | ADD scripts /scripts 25 | 26 | EXPOSE 8080 8443 27 | 28 | ENTRYPOINT ["/scripts/run"] 29 | 30 | ONBUILD ADD . ${APP_DIR} 31 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/README.md: -------------------------------------------------------------------------------- 1 | 1. 创建镜像 2 | 执行 `docker build -t bw/tomcat .` 命令 3 | 1. 进入容器: 4 | 执行 `docker run -i -t -p 18080:8080 bw/tomcat` 5 | 1. 启动tomcat: 6 | 1. `./usr/local/apache-tomcat-8.5.6/bin/startup.sh` 7 | 1. 启动完后可以通过宿主机的18080端口访问,或通过Container的8080端口访问 8 | 1. 也可以使用-v进行共享宿主机目录启动: 9 | 1. `docker run -i -t -p 18080:8080 -v /home/ubuntu/docker:/opt/data bw/tomcat` 10 | 1. 把主机的/usr/local/dockerData挂载到Container的/usr/local/docker目录上用于共享数据 11 | 12 | 1. 对容器进行修改后可以保存镜像用于以后继续使用 13 | 14 | `docker commit containerID bw/tomcat3` 把容器containerID保存为镜像 15 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/scripts/create_tomcat_admin_user: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Generate tomcat user password 6 | TOMCAT_USER=${TOMCAT_USER:-admin} 7 | TOMCAT_PASS=${TOMCAT_PASS:-csphere2015} 8 | 9 | echo "=> Creating and admin user with a ${_word} password in Tomcat" 10 | sed -i -r 's/<\/tomcat-users>//' ${CATALINA_HOME}/conf/tomcat-users.xml 11 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 12 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 13 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 14 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 15 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 16 | echo "" >> ${CATALINA_HOME}/conf/tomcat-users.xml 17 | echo '' >> ${CATALINA_HOME}/conf/tomcat-users.xml 18 | echo "=> Done!" 19 | 20 | echo "========================================================================" 21 | echo "You can now configure to this Tomcat server using:" 22 | echo "" 23 | echo " ${TOMCAT_USER}:${TOMCAT_PASS}" 24 | echo "" 25 | echo "========================================================================" -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/scripts/firstrun: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-Tomcat/docker-tomcat/scripts/firstrun -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat/scripts/run: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | if [[ -e /scripts/firstrun ]]; then 6 | # config tomcat user and pass 7 | /scripts/create_tomcat_admin_user 8 | rm /scripts/create_tomcat_admin_user 9 | rm /scripts/firstrun 10 | rm /tomcat/webapps/ROOT 11 | rm /tomcat/webapps/docs 12 | rm /tomcat/webapps/examples 13 | rm /tomcat/webapps/host-manager 14 | fi 15 | 16 | exec ${CATALINA_HOME}/bin/catalina.sh run -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:12.04 2 | MAINTAINER binarywang 3 | 4 | #把java与tomcat添加到容器中 5 | ADD jdk-8u111-linux-x64.tar.gz /opt/app/ 6 | ADD apache-tomcat-8.5.6.tar.gz /opt/app/ 7 | 8 | #配置java与tomcat环境变量 9 | ENV JAVA_HOME /opt/app/jdk1.8.0_111 10 | ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar 11 | ENV CATALINA_HOME /opt/app/apache-tomcat-8.5.6 12 | ENV CATALINA_BASE /opt/app/apache-tomcat-8.5.6 13 | ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin 14 | 15 | #容器运行时监听的端口 16 | EXPOSE 8080 -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat8/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:7 2 | MAINTAINER Frank.Wu 3 | 4 | #install some tools 5 | RUN yum install -y \ 6 | wget \ 7 | tar && \ 8 | yum clean all && rm -rf /var/cache/yum/* 9 | 10 | #set java env 11 | ENV JAVA_VERSION=1.8.0_45 12 | ENV JAVA_TARBALL=server-jre-8u45-linux-x64.tar.gz 13 | ENV JAVA_HOME=/opt/java/jdk${JAVA_VERSION} 14 | 15 | #download 16 | RUN wget --no-check-certificate --directory-prefix=/tmp \ 17 | --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \ 18 | http://download.oracle.com/otn-pub/java/jdk/8u45-b14/${JAVA_TARBALL} && \ 19 | mkdir -p /opt/java && \ 20 | tar -xzf /tmp/${JAVA_TARBALL} -C /opt/java/ && \ 21 | alternatives --install /usr/bin/java java /opt/java/jdk${JAVA_VERSION}/bin/java 100 && \ 22 | rm -rf /tmp/* && rm -rf /var/log/* 23 | 24 | #set tomcat env 25 | ENV TOMCAT_VERSION 8.0.24 26 | ENV CATALINA_HOME /opt/tomcat 27 | 28 | #download 29 | RUN cd /opt && \ 30 | wget -q http://apache.fayea.com/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.tar.gz -O /opt/tomcat.tar.gz && \ 31 | tar -zxvf /opt/tomcat.tar.gz && \ 32 | rm /opt/tomcat.tar.gz && \ 33 | ln -s /opt/apache-tomcat-${TOMCAT_VERSION} /opt/tomcat 34 | 35 | #add user 36 | ADD ["tomcat-users.xml", "$CATALINA_HOME/conf/tomcat-users.xml"] 37 | 38 | EXPOSE 8080 39 | 40 | CMD $CATALINA_HOME/bin/catalina.sh run 41 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat8/README.md: -------------------------------------------------------------------------------- 1 | #Tomcat8 + Oracle JDK8 + CentOS7 2 | 3 | 4 | 5 | ##Build: 6 | ``` 7 | docker build -t tomcat . 8 | ``` 9 | 10 | ##Login: 11 | ``` 12 | docker run -i -t tomcat /bin/bash 13 | ``` 14 | 15 | ##Run: 16 | ``` 17 | docker run -p 8080:8080 -d tomcat 18 | ``` 19 | 20 | ##USER 21 | ``` 22 | docker/docker 23 | ``` 24 | -------------------------------------------------------------------------------- /docker-Tomcat/docker-tomcat8/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docker-Ubuntu/Docker 安装 Ubuntu.md: -------------------------------------------------------------------------------- 1 | # Docker 安装 Ubuntu 2 | 3 | Ubuntu 是基于 Debian 的 Linux 操作系统。 4 | 5 | ### 1、查看可用的 Ubuntu 版本 6 | 7 | 访问 Ubuntu 镜像库地址: https://hub.docker.com/_/ubuntu?tab=tags&page=1。 8 | 9 | 可以通过 Sort by 查看其他版本的 Ubuntu。默认是最新版本 ubuntu:latest 。 10 | 11 | ![img](https://www.runoob.com/wp-content/uploads/2019/11/94445DF8-211F-4D27-8E0A-BBED71E86F41.jpg) 12 | 13 | 你也可以在下拉列表中找到其他你想要的版本: 14 | 15 | ![img](https://www.runoob.com/wp-content/uploads/2019/11/D872D73A-EC8D-427B-8265-41B2C815A2A0.jpg) 16 | 17 | ### 2、拉取最新版的 Ubuntu 镜像 18 | 19 | ``` 20 | $ docker pull ubuntu 21 | ``` 22 | 23 | 或者: 24 | 25 | ``` 26 | $ docker pull ubuntu:latest 27 | ``` 28 | 29 | [![img](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu1.png)](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu1.png) 30 | 31 | ### 3、查看本地镜像 32 | 33 | ``` 34 | $ docker images 35 | ``` 36 | 37 | [![img](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu2.png)](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu2.png) 38 | 39 | 在上图中可以看到我们已经安装了最新版本的 ubuntu。 40 | 41 | ### 4、运行容器,并且可以通过 exec 命令进入 ubuntu 容器 42 | 43 | ``` 44 | $ docker run -itd --name ubuntu-test ubuntu 45 | ``` 46 | 47 | [![img](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu3.png)](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu3.png) 48 | 49 | ### 5、安装成功 50 | 51 | 最后我们可以通过 **docker ps** 命令查看容器的运行信息: 52 | 53 | [![img](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu4.png)](https://www.runoob.com/wp-content/uploads/2019/11/docker-ubuntu4.png) -------------------------------------------------------------------------------- /docker-Ubuntu/docker-study/redis/Dockerfile: -------------------------------------------------------------------------------- 1 | # http://git.oschina.net/ahern88/docker-redis 2 | FROM ubuntu:14.04.3LTS 3 | 4 | RUN apt-get update 5 | 6 | RUN apt-get -y install redis-server 7 | 8 | EXPOSE 6379 9 | 10 | ENTRYPOINT ["/usr/bin/redis-server"] 11 | 12 | # Access Example 13 | # redis-cli -h host -p open_port -------------------------------------------------------------------------------- /docker-Ubuntu/docker-study/ssh/Dockerfile: -------------------------------------------------------------------------------- 1 | # http://docker.widuu.com/examples/running_ssh_service.html 2 | FROM ubuntu:14.04.3LTS 3 | 4 | RUN apt-get update 5 | 6 | RUN apt-get install -y openssh-server 7 | 8 | RUN mkdir /var/run/sshd 9 | 10 | RUN echo 'root:root' | chpasswd 11 | 12 | EXPOSE 22 13 | 14 | CMD ["/usr/sbin/sshd", "-D"] -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER Ryan_Newman <15244909057.ww@gmail.com> 3 | 4 | # use china souce 5 | # copy ./apt/sources.list /etc/apt/sources.list 6 | 7 | # update software 8 | 9 | RUN apt-get -y update 10 | RUN apt-get -y upgrade 11 | 12 | # install apache2 13 | 14 | RUN apt-get -y install apache2 15 | 16 | # install php and plugin 17 | 18 | RUN apt-get -y install php7.0 libapache2-mod-php7.0 php7.0-mysql php7.0-common php7.0-zip php7.0-mbstring php7.0-mcrypt php7.0-json php7.0-gd php7.0-curl 19 | 20 | # install supervisor 21 | 22 | RUN apt-get -y install supervisor 23 | 24 | # copy configure file 25 | 26 | ## apache2 conf 27 | ADD ./apache2/apache2.conf /etc/apache2/apache2.conf 28 | ADD ./apache2/ports.conf /etc/apache2/ports.conf 29 | ADD ./apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf 30 | ADD ./apache2/sites-available/default-ssl.conf /etc/apache2/sites-available/default-ssl.conf 31 | ADD ./apache2/sites-enabled/000-default.conf /etc/apache2/sites-enabled/000-default.conf 32 | 33 | ## supervisor conf 34 | ADD ./supervisor/supervisord.conf /etc/supervisor/supervisord.conf 35 | ADD ./supervisor/conf.d/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 36 | 37 | # run container 38 | 39 | EXPOSE 80 443 40 | 41 | CMD ["/usr/bin/supervisord"] 42 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/README.md: -------------------------------------------------------------------------------- 1 | # 基于Docker的PHP服务搭建 2 | 3 | ## 一.使用方法 4 | ### 1.使用docker build -t 镜像名:版本号 路径 5 | #### 例子:docker build -t lamp:latest . 6 | #### 表示使用当前路径的Dockerfile文件生成镜像 7 | ## 二.安装的软件 8 | #### 1.apache2 用于HTTP服务 9 | #### 2.php7.0 用于处理PHP脚本 10 | #### 3.php7.0-mysql 用于PHP连接mysql 11 | #### 4.libapache2-mod-php7.0 使apache能处理PHP脚本 12 | #### 5.php7.0-json 为PHP脚本提供json的处理 13 | #### 6.php7.0-gd 为PHP提供图片的处理能力 14 | #### 7.supervisord 用于对其它软件的监控,主要实现对进程的启动以及进程意外停止的自动开启(在docker容器中默认不能使用systemctl或service等命令,所以需要supervisor对进程进行管理) 15 | ## 三.文件介绍 16 | ### 1.apache/apache2.conf 17 | #### apache配置文件 18 | ### 2.apache/sites-enabled/000-default.conf 19 | #### apache监听的端口号,以及虚拟主机路径的配置 20 | ### 3.apt/sources.list 21 | #### ubuntu16.04的网易源配置文件(主要用于国内构建镜像,国内使用默认源会非常慢甚至构建失败。) 22 | ### 4.supervisor/conf.d/supervisord.conf 23 | #### supervisord的配置文件(包含supervisord需要监听的进程) 24 | ## 四.注意事项 25 | ### 1.运行镜像时默认配置的网站跟目录为/data/wwwroot/default 26 | #### 运行容器时需要使用-v /data:/data为容器挂载卷,并把网站代码放在主机的/data/wwwroot/default下,并且网站入口文件为index.php或index.html 27 | ### 2.需要注意目录权限问题,要给容器足够的权限 28 | #### 发生其它奇怪的问题可以在运行容器时加--privileged给容器特权 29 | ### 3.当然还要端口映射了 30 | #### -p 端口号:端口号 将主机的 端口与容器的端口进行映射 31 | ### 4.如何使用mysql 32 | #### 容器默认未提供mysql服务,需要先pull一个mysql容器,并运行,然后再运行lamp容器并添加--link mysql:mysql PHP如何调用数据库,其实调用数据库时只需要将连接数据库的主机名填写为mysql就能够直接连接,必须先启动mysql容器再启动lamp容器,因为lamp容器会依赖mysql容器。 33 | ### 5.完整运行命令例子 34 | ``` 35 | docker run --privileged --name lamp -d -v /data:/data -p 80:80 -p 443:443 lamp:latest 36 | ``` 37 | ### 6.个性化 38 | #### 可以更改项目中对应软件的配置文件实现其它的个性化设置,然后再构建容器镜像 39 | ### 7.演示 40 | ![](https://git.oschina.net/lebar/docker-ubuntu-apache2-supervisord/raw/master/thumbnail.png) -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apache2/help.txt: -------------------------------------------------------------------------------- 1 | use ubuntu 2 | location 3 | /etc/apache2 4 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apache2/ports.conf: -------------------------------------------------------------------------------- 1 | # If you just change the port or add more ports here, you will likely also 2 | # have to change the VirtualHost statement in 3 | # /etc/apache2/sites-enabled/000-default.conf 4 | 5 | Listen 80 6 | 7 | 8 | Listen 443 9 | 10 | 11 | 12 | Listen 443 13 | 14 | 15 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 16 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apache2/sites-available/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | # The ServerName directive sets the request scheme, hostname and port that 3 | # the server uses to identify itself. This is used when creating 4 | # redirection URLs. In the context of virtual hosts, the ServerName 5 | # specifies what hostname must appear in the request's Host: header to 6 | # match this virtual host. For the default virtual host (this file) this 7 | # value is not decisive as it is used as a last resort host regardless. 8 | # However, you must set it for any further virtual host explicitly. 9 | #ServerName www.example.com 10 | 11 | ServerAdmin webmaster@localhost 12 | DocumentRoot /data/wwwroot/default 13 | 14 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 15 | # error, crit, alert, emerg. 16 | # It is also possible to configure the loglevel for particular 17 | # modules, e.g. 18 | #LogLevel info ssl:warn 19 | 20 | ErrorLog ${APACHE_LOG_DIR}/error.log 21 | CustomLog ${APACHE_LOG_DIR}/access.log combined 22 | 23 | # For most configuration files from conf-available/, which are 24 | # enabled or disabled at a global level, it is possible to 25 | # include a line for only one particular virtual host. For example the 26 | # following line enables the CGI configuration for this host only 27 | # after it has been globally disabled with "a2disconf". 28 | #Include conf-available/serve-cgi-bin.conf 29 | 30 | 31 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 32 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apache2/sites-available/help.txt: -------------------------------------------------------------------------------- 1 | use ubuntu 2 | path 3 | /etc/apache2/sites-available 4 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apache2/sites-enabled/000-default.conf: -------------------------------------------------------------------------------- 1 | 2 | # The ServerName directive sets the request scheme, hostname and port that 3 | # the server uses to identify itself. This is used when creating 4 | # redirection URLs. In the context of virtual hosts, the ServerName 5 | # specifies what hostname must appear in the request's Host: header to 6 | # match this virtual host. For the default virtual host (this file) this 7 | # value is not decisive as it is used as a last resort host regardless. 8 | # However, you must set it for any further virtual host explicitly. 9 | #ServerName www.example.com 10 | 11 | ServerAdmin webmaster@localhost 12 | DocumentRoot /data/wwwroot/default 13 | 14 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 15 | # error, crit, alert, emerg. 16 | # It is also possible to configure the loglevel for particular 17 | # modules, e.g. 18 | #LogLevel info ssl:warn 19 | 20 | ErrorLog ${APACHE_LOG_DIR}/error.log 21 | CustomLog ${APACHE_LOG_DIR}/access.log combined 22 | 23 | # For most configuration files from conf-available/, which are 24 | # enabled or disabled at a global level, it is possible to 25 | # include a line for only one particular virtual host. For example the 26 | # following line enables the CGI configuration for this host only 27 | # after it has been globally disabled with "a2disconf". 28 | #Include conf-available/serve-cgi-bin.conf 29 | 30 | 31 | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet 32 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apache2/sites-enabled/help.txt: -------------------------------------------------------------------------------- 1 | use ubuntu 2 | path 3 | /etc/apache2/sites-enabled 4 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/apt/help.txt: -------------------------------------------------------------------------------- 1 | use ubuntu 2 | path 3 | /etc/apt 4 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/supervisor/conf.d/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | [program:sshd] 4 | command=/usr/sbin/sshd -D 5 | 6 | [program:apache2] 7 | command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND" 8 | 9 | [mysqld] 10 | command=/usr/sbin/mysqld 11 | 12 | 13 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/supervisor/help.txt: -------------------------------------------------------------------------------- 1 | use ubuntu 2 | path 3 | /etc/supervisor 4 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/supervisor/supervisord.conf: -------------------------------------------------------------------------------- 1 | ; supervisor config file 2 | 3 | [unix_http_server] 4 | file=/var/run/supervisor.sock ; (the path to the socket file) 5 | chmod=0700 ; sockef file mode (default 0700) 6 | 7 | [supervisord] 8 | logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) 9 | pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 10 | childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) 11 | 12 | ; the below section must remain in the config file for RPC 13 | ; (supervisorctl/web interface) to work, additional interfaces may be 14 | ; added by defining them in separate rpcinterface: sections 15 | [rpcinterface:supervisor] 16 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 17 | 18 | [supervisorctl] 19 | serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket 20 | 21 | ; The [include] section can just contain the "files" setting. This 22 | ; setting can list multiple files (separated by whitespace or 23 | ; newlines). It can also contain wildcards. The filenames are 24 | ; interpreted as relative to this file. Included files *cannot* 25 | ; include files themselves. 26 | 27 | [include] 28 | files = /etc/supervisor/conf.d/*.conf 29 | -------------------------------------------------------------------------------- /docker-Ubuntu/docker-ubuntu-apache2-supervisord/thumbnail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-Ubuntu/docker-ubuntu-apache2-supervisord/thumbnail.png -------------------------------------------------------------------------------- /docker-WebSphereMQ/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM xsh/wmq75:0.1 2 | 3 | RUN yum install -y python-setuptools && easy_install supervisor && mkdir -p /var/log/supervisor 4 | 5 | COPY supervisord.conf /usr/etc/supervisord.conf 6 | COPY start_queue_manager.sh / 7 | RUN chmod +x /start_queue_manager.sh 8 | 9 | EXPOSE 1414 10 | 11 | CMD ["/usr/bin/supervisord"] 12 | -------------------------------------------------------------------------------- /docker-WebSphereMQ/Dockerfile2: -------------------------------------------------------------------------------- 1 | FROM centos:7.1.1503 2 | 3 | COPY software/WS_MQ_LINUX_ON_X86_64_7.5.0.2_IMG.tar.gz /software/WS_MQ_LINUX_ON_X86_64_7.5.0.2_IMG.tar.gz 4 | 5 | RUN yum install -y tar 6 | RUN cd /software && tar xzf WS_MQ_LINUX_ON_X86_64_7.5.0.2_IMG.tar.gz && ./mqlicense.sh -accept -text_only && rpm -ivh MQSeriesRuntime-*.rpm MQSeriesServer-*.rpm && rm -rf /software 7 | 8 | RUN yum install -y python-setuptools && easy_install supervisor && mkdir -p /var/log/supervisor 9 | 10 | COPY supervisord.conf /usr/etc/supervisord.conf 11 | COPY start_queue_manager.sh / 12 | RUN chmod +x /start_queue_manager.sh 13 | 14 | EXPOSE 1414 15 | 16 | CMD ["/usr/bin/supervisord"] 17 | -------------------------------------------------------------------------------- /docker-WebSphereMQ/start_queue_manager.sh: -------------------------------------------------------------------------------- 1 | export MYTEMPQM=TESTQM 2 | export MYPORT=1414 3 | 4 | source /opt/mqm/bin/setmqenv -s 5 | crtmqm -u SYSTEM.DEAD.LETTER.QUEUE $MYTEMPQM 6 | strmqm $MYTEMPQM 7 | runmqsc $MYTEMPQM << EOF 8 | define listener(TCP.LISTENER) trptype(tcp) control(qmgr) port($MYPORT) 9 | start listener(TCP.LISTENER) 10 | define channel(SYSTEM.ADMIN.SVRCONN) chltype(SVRCONN) REPLACE 11 | set CHLAUTH(*) TYPE(BLOCKUSER) USERLIST('nobody','*MQADMIN') 12 | set CHLAUTH(SYSTEM.ADMIN.*) TYPE(BLOCKUSER) USERLIST('nobody') 13 | EOF 14 | 15 | -------------------------------------------------------------------------------- /docker-WebSphereMQ/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:sshd] 5 | command=su mqm -c /start_queue_manager.sh 6 | -------------------------------------------------------------------------------- /docker-Wordpress/docker-wordpress/.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | WordPress/.git 3 | -------------------------------------------------------------------------------- /docker-Wordpress/docker-wordpress/.htaccess: -------------------------------------------------------------------------------- 1 | # BEGIN WordPress 2 | 3 | RewriteEngine On 4 | RewriteBase ROOT_PATH/ 5 | RewriteRule ^index\.php$ - [L] 6 | RewriteCond %{REQUEST_FILENAME} !-f 7 | RewriteCond %{REQUEST_FILENAME} !-d 8 | RewriteRule . ROOT_PATH/index.php [L] 9 | 10 | 11 | # END WordPress 12 | -------------------------------------------------------------------------------- /docker-Wordpress/docker-wordpress/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM zcy/apache-php:latest 2 | MAINTAINER chunyuan Zhang 3 | 4 | ENV WORDPRESS_VER 4.5.2 5 | WORKDIR / 6 | RUN apt-get update && \ 7 | apt-get -yq install mysql-client curl && \ 8 | rm -rf /app && \ 9 | curl -0L http://wordpress.org/wordpress-${WORDPRESS_VER}.tar.gz | tar zxv && \ 10 | mv /wordpress /app && \ 11 | rm -rf /var/lib/apt/lists/* 12 | 13 | RUN sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf 14 | RUN a2enmod rewrite 15 | ADD .htaccess /app/.htaccess 16 | ADD wp-config.php /app/wp-config.php 17 | ADD run.sh /run.sh 18 | RUN chmod +x /*.sh 19 | 20 | # Expose environment variables 21 | ENV DB_HOST **LinkMe** 22 | ENV DB_PORT **LinkMe** 23 | ENV DB_NAME wordpress 24 | ENV DB_USER admin 25 | ENV DB_PASS **ChangeMe** 26 | ENV ROOT_PATH / 27 | 28 | EXPOSE 80 29 | VOLUME ["/app/wp-content"] 30 | CMD ["/run.sh"] 31 | -------------------------------------------------------------------------------- /docker-Wordpress/docker-wordpress/wordpress.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | # The ServerName directive sets the request scheme, hostname and port that 4 | # the server uses to identify itself. This is used when creating 5 | # redirection URLs. In the context of virtual hosts, the ServerName 6 | # specifies what hostname must appear in the request's Host: header to 7 | # match this virtual host. For the default virtual host (this file) this 8 | # value is not decisive as it is used as a last resort host regardless. 9 | # However, you must set it for any further virtual host explicitly. 10 | #ServerName www.example.com 11 | 12 | ServerAdmin webmaster@localhost 13 | DocumentRoot /var/www/html 14 | 15 | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, 16 | # error, crit, alert, emerg. 17 | # It is also possible to configure the loglevel for particular 18 | # modules, e.g. 19 | #LogLevel info ssl:warn 20 | 21 | ErrorLog ${APACHE_LOG_DIR}/error.log 22 | CustomLog ${APACHE_LOG_DIR}/access.log combined 23 | 24 | # For most configuration files from conf-available/, which are 25 | # enabled or disabled at a global level, it is possible to 26 | # include a line for only one particular virtual host. For example the 27 | # following line enables the CGI configuration for this host only 28 | # after it has been globally disabled with "a2disconf". 29 | #Include conf-available/serve-cgi-bin.conf 30 | 31 | Options Indexes FollowSymLinks MultiViews 32 | AllowOverride All 33 | Order allow,deny 34 | allow from all 35 | 36 | 37 | -------------------------------------------------------------------------------- /docker-Wordpress/使用Docker搭建一个WordPress博客.one: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-Wordpress/使用Docker搭建一个WordPress博客.one -------------------------------------------------------------------------------- /docker-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | # 参考:https://github.com/gnulife/dphp/blob/master/alpine/build.sh制作。感谢! 2 | FROM alpine 3 | MAINTAINER Alpine Docker Maintainers "zhijiantianya@gmail.com" 4 | 5 | RUN \ 6 | # 阿里云镜像 7 | echo 'http://mirrors.aliyun.com/alpine/latest-stable/main' > /etc/apk/repositories \ 8 | && echo '@community http://mirrors.aliyun.com/alpine/latest-stable/community' >> /etc/apk/repositories \ 9 | && echo '@testing http://mirrors.aliyun.com/alpine/edge/testing' >> /etc/apk/repositories \ 10 | && apk update \ 11 | # 时区 12 | && TIMEZONE="Asia/Shanghai" \ 13 | && apk add tzdata \ 14 | && ln -snf /usr/share/zoneinfo/$TIMEZONE /etc/localtime \ 15 | && echo $TIMEZONE > /etc/timezone 16 | 17 | # 容器命令执行 18 | CMD ["sh"] 19 | -------------------------------------------------------------------------------- /docker-alpine/README.md: -------------------------------------------------------------------------------- 1 | # docker-alpine 2 | docker-alpine -------------------------------------------------------------------------------- /docker-alpine/alpine-java/alpine-java-dockerfile: -------------------------------------------------------------------------------- 1 | # from myharbor.com/base/alpine:sshd 2 | FROM myharbor.com/base/alpine:sshd 3 | 4 | # maintainer 5 | MAINTAINER "rancococ" 6 | 7 | # set arg info 8 | ARG MYJRE_HOME=/data/myjre 9 | ARG MYJRE_VER=8u181 10 | ARG MYJRE_URL=http://download.oracle.com/otn-pub/java/jdk/8u181-b13/96a7b8442fe848ef90c96a2fad6ed6d1/server-jre-8u181-linux-x64.tar.gz 11 | 12 | # copy script 13 | 14 | # install and serverjre 15 | RUN echo \>\>\>download serverjre from ${MYJRE_URL} && \ 16 | echo \>\>\>serverjre version : ${MYJRE_VER} && \ 17 | wget -c -O /tmp/myjre.tar.gz --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" ${MYJRE_URL} && \ 18 | tar -zxf /tmp/myjre.tar.gz -C /tmp/ && \ 19 | myjrename=$(tar -tf /tmp/myjre.tar.gz | awk -F "/" '{print $1}' | sed -n '1p') && \ 20 | mkdir -p ${MYJRE_HOME} && \ 21 | \cp -rf /tmp/${myjrename}/jre/. ${MYJRE_HOME} && \ 22 | \rm -rf /tmp/* && \ 23 | chown -R myapp:myapp ${MYJRE_HOME} && \ 24 | sed -i 's/#crypto.policy=unlimited/crypto.policy=unlimited/g' "${MYJRE_HOME}/lib/security/java.security" && \ 25 | chmod -Rf u+x ${MYJRE_HOME}/bin/* && \ 26 | chmod -Rf u+x /docker-entrypoint.sh && \ 27 | chown -R myapp:myapp /docker-entrypoint.sh && \ 28 | chown -R myapp:myapp ${MYJRE_HOME} 29 | 30 | # set environment 31 | ENV JAVA_HOME ${MYJRE_HOME} 32 | ENV CLASSPATH .:${MYJRE_HOME}/lib 33 | ENV PATH .:${PATH}:${MYJRE_HOME}/bin 34 | 35 | # set work home 36 | WORKDIR /data 37 | 38 | # stop signal 39 | STOPSIGNAL SIGTERM 40 | 41 | # entry point 42 | ENTRYPOINT ["/docker-entrypoint.sh"] 43 | 44 | # default command 45 | CMD ["java", "-version"] 46 | -------------------------------------------------------------------------------- /docker-alpine/alpine-java/alpine-java-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | DOCKER_REPOSTORY=myharbor.com 19 | DOCKER_PROJECT=base 20 | DOCKER_IMAGE=alpine 21 | 22 | docker run -it --rm --name java-1.8.181 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:java-1.8.181 "" 23 | docker run -it --rm --name java-1.8.181 -p 10022:22 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:java-1.8.181 "" 24 | docker run -it --rm --name java-1.8.181 -p 18080:8080 -p 10001:10001 -p 10002:10002 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:java-1.8.181 "bash" 25 | -------------------------------------------------------------------------------- /docker-alpine/alpine-singleapp/alpine-singleapp-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | DOCKER_REPOSTORY=myharbor.com 19 | DOCKER_PROJECT=base 20 | DOCKER_IMAGE=alpine 21 | DOCKER_FILE=alpine-singleapp-dockerfile 22 | 23 | docker build --rm \ 24 | --no-cache \ 25 | --add-host assets-cdn.github.com:151.101.72.133 \ 26 | --add-host github.global.ssl.fastly.net:151.101.13.194 \ 27 | --add-host github.global.ssl.fastly.net:151.101.73.194 \ 28 | --add-host github.global.ssl.fastly.net:151.101.113.194 \ 29 | --add-host github.com:192.30.253.112 \ 30 | --add-host github.com:192.30.253.113 \ 31 | --add-host codeload.github.com:192.30.253.120 \ 32 | --add-host codeload.github.com:192.30.253.121 \ 33 | --add-host raw.githubusercontent.com:151.101.72.133 \ 34 | --build-arg MYAPP_VER=1.0.2 \ 35 | -t ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:singleapp-1.0.2 \ 36 | -t ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:singleapp-1.0 \ 37 | -f ${DOCKER_FILE} . 38 | -------------------------------------------------------------------------------- /docker-alpine/alpine-singleapp/alpine-singleapp-dockerfile: -------------------------------------------------------------------------------- 1 | # from myharbor.com/base/alpine:java-1.8 2 | FROM myharbor.com/base/alpine:java-1.8 3 | 4 | # maintainer 5 | MAINTAINER "rancococ" 6 | 7 | # set arg info 8 | ARG MYAPP_HOME=/data/myapp 9 | ARG MYAPP_VER=1.0.0 10 | ARG MYAPP_URL=https://github.com/rancococ/singleapp/archive/${MYAPP_VER}.tar.gz 11 | 12 | # copy script 13 | 14 | # install singleapp 15 | RUN echo \>\>\>download singleapp from ${MYAPP_URL} && \ 16 | echo \>\>\>singleapp version : ${MYAPP_VER} && \ 17 | wget -c -O /tmp/myapp.tar.gz --no-check-certificate ${MYAPP_URL} && \ 18 | tar -zxf /tmp/myapp.tar.gz -C /tmp/ && \ 19 | myappname=$(tar -tf /tmp/myapp.tar.gz | awk -F "/" '{print $1}' | sed -n '1p') && \ 20 | mkdir -p ${MYAPP_HOME} && \ 21 | \cp -rf /tmp/${myappname}/. ${MYAPP_HOME} && \ 22 | \rm -rf /tmp/* && \ 23 | chown -R myapp:myapp ${MYAPP_HOME} && \ 24 | sed -i 's/^set.JAVA_HOME/#&/g' "${MYAPP_HOME}/conf/wrapper.conf" && \ 25 | chmod -Rf u+x ${MYAPP_HOME}/bin/*.sh && \ 26 | chmod -Rf u+x ${MYAPP_HOME}/bin/*linux* && \ 27 | ${MYAPP_HOME}/bin/liblink.sh && \ 28 | chmod 600 ${MYAPP_HOME}/conf/jmxremote.password && \ 29 | chmod 777 ${MYAPP_HOME}/logs && \ 30 | chmod 777 ${MYAPP_HOME}/temp && \ 31 | chmod -Rf u+x /docker-entrypoint.sh && \ 32 | chown -R myapp:myapp /docker-entrypoint.sh && \ 33 | chown -R myapp:myapp ${MYAPP_HOME} 34 | 35 | # set work home 36 | WORKDIR /data 37 | 38 | # expose port 39 | EXPOSE 8080 10087 10001 10002 40 | 41 | # stop signal 42 | STOPSIGNAL SIGTERM 43 | 44 | # entry point 45 | ENTRYPOINT ["/docker-entrypoint.sh"] 46 | 47 | # default command 48 | CMD ["/data/myapp/bin/wrapper-console-start.sh"] 49 | -------------------------------------------------------------------------------- /docker-alpine/alpine-singleapp/alpine-singleapp-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | DOCKER_REPOSTORY=myharbor.com 19 | DOCKER_PROJECT=base 20 | DOCKER_IMAGE=alpine 21 | 22 | docker run -it --rm --name singleapp-1.0.0 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:singleapp-1.0.0 "" 23 | docker run -it --rm --name singleapp-1.0.0 -p 10022:22 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:singleapp-1.0.0 "" 24 | docker run -it --rm --name singleapp-1.0.0 -p 18080:8080 -p 10001:10001 -p 10002:10002 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:singleapp-1.0.0 "/data/myapp/bin/wrapper-console-start.sh" 25 | -------------------------------------------------------------------------------- /docker-alpine/alpine-sshd/alpine-sshd-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | DOCKER_REPOSTORY=myharbor.com 19 | DOCKER_PROJECT=base 20 | DOCKER_IMAGE=alpine 21 | DOCKER_FILE=alpine-sshd-dockerfile 22 | 23 | docker build --rm \ 24 | --no-cache \ 25 | --add-host assets-cdn.github.com:151.101.72.133 \ 26 | --add-host github.global.ssl.fastly.net:151.101.13.194 \ 27 | --add-host github.global.ssl.fastly.net:151.101.73.194 \ 28 | --add-host github.global.ssl.fastly.net:151.101.113.194 \ 29 | --add-host github.com:192.30.253.112 \ 30 | --add-host github.com:192.30.253.113 \ 31 | --add-host codeload.github.com:192.30.253.120 \ 32 | --add-host codeload.github.com:192.30.253.121 \ 33 | --add-host raw.githubusercontent.com:151.101.72.133 \ 34 | --build-arg ALPINE_VER=v3.8 \ 35 | --build-arg GOSU_VER=1.10 \ 36 | --build-arg GOSU_ARCH=amd64 \ 37 | -t ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:sshd \ 38 | -f ${DOCKER_FILE} . 39 | -------------------------------------------------------------------------------- /docker-alpine/alpine-sshd/alpine-sshd-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | DOCKER_REPOSTORY=myharbor.com 19 | DOCKER_PROJECT=base 20 | DOCKER_IMAGE=alpine 21 | 22 | docker run -it --rm --name sshd -p 10022:22 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:sshd "" 23 | -------------------------------------------------------------------------------- /docker-alpine/alpine-sshd/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # exec docker-preprocess.sh 6 | if [ -x "/docker-preprocess.sh" ]; then 7 | . "/docker-preprocess.sh" 8 | fi 9 | 10 | # current user is root 11 | if [ "$(id -u)" = "0" ]; then 12 | # no parameter 13 | if [ -z "$1" ]; then 14 | # exec default command 15 | exec /bin/sh -c "/usr/sbin/sshd -D" 16 | fi 17 | # has parameter 18 | if [ -n "$1" ]; then 19 | # exec by myapp 20 | exec gosu myapp "$@" 21 | fi 22 | fi 23 | 24 | # current user is not root 25 | # exec by spec user 26 | exec "$@" 27 | -------------------------------------------------------------------------------- /docker-alpine/alpine-tomcatapp/alpine-tomcatapp-dockerfile: -------------------------------------------------------------------------------- 1 | # from myharbor.com/base/alpine:java-1.8 2 | FROM myharbor.com/base/alpine:java-1.8 3 | 4 | # maintainer 5 | MAINTAINER "rancococ" 6 | 7 | # set arg info 8 | ARG MYAPP_HOME=/data/myapp 9 | ARG MYAPP_VER=8.0.52 10 | ARG MYAPP_URL=https://github.com/rancococ/tomcatapp/archive/${MYAPP_VER}.tar.gz 11 | 12 | # copy script 13 | 14 | # install tomcatapp 15 | RUN echo \>\>\>download tomcatapp from ${MYAPP_URL} && \ 16 | echo \>\>\>tomcatapp version : ${MYAPP_VER} && \ 17 | wget -c -O /tmp/myapp.tar.gz --no-check-certificate ${MYAPP_URL} && \ 18 | tar -zxf /tmp/myapp.tar.gz -C /tmp/ && \ 19 | myappname=$(tar -tf /tmp/myapp.tar.gz | awk -F "/" '{print $1}' | sed -n '1p') && \ 20 | mkdir -p ${MYAPP_HOME} && \ 21 | \cp -rf /tmp/${myappname}/. ${MYAPP_HOME} && \ 22 | \rm -rf /tmp/* && \ 23 | chown -R myapp:myapp ${MYAPP_HOME} && \ 24 | sed -i 's/^set.JAVA_HOME/#&/g' "${MYAPP_HOME}/conf/wrapper.conf" && \ 25 | chmod -Rf u+x ${MYAPP_HOME}/bin/*.sh && \ 26 | chmod -Rf u+x ${MYAPP_HOME}/bin/*linux* && \ 27 | ${MYAPP_HOME}/bin/liblink.sh && \ 28 | chmod 600 ${MYAPP_HOME}/conf/jmxremote.password && \ 29 | chmod 777 ${MYAPP_HOME}/logs && \ 30 | chmod 777 ${MYAPP_HOME}/temp && \ 31 | chmod -Rf u+x /docker-entrypoint.sh && \ 32 | chown -R myapp:myapp /docker-entrypoint.sh && \ 33 | chown -R myapp:myapp ${MYAPP_HOME} 34 | 35 | # set work home 36 | WORKDIR /data 37 | 38 | # expose port 39 | EXPOSE 8080 10087 10001 10002 40 | 41 | # stop signal 42 | STOPSIGNAL SIGTERM 43 | 44 | # entry point 45 | ENTRYPOINT ["/docker-entrypoint.sh"] 46 | 47 | # default command 48 | CMD ["/data/myapp/bin/wrapper-console-start.sh"] 49 | -------------------------------------------------------------------------------- /docker-alpine/alpine-tomcatapp/alpine-tomcatapp-run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | DOCKER_REPOSTORY=myharbor.com 19 | DOCKER_PROJECT=base 20 | DOCKER_IMAGE=alpine 21 | 22 | docker run -it --rm --name tomcatapp-8.0.52 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:tomcatapp-8.0.52 "" 23 | docker run -it --rm --name tomcatapp-8.0.52 -p 10022:22 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:tomcatapp-8.0.52 "" 24 | docker run -it --rm --name tomcatapp-8.0.52 -p 18080:8080 -p 10001:10001 -p 10002:10002 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:tomcatapp-8.0.52 "/data/myapp/bin/wrapper-console-start.sh" 25 | 26 | docker run -it --rm --name tomcatapp-8.5.31 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:tomcatapp-8.5.31 "" 27 | docker run -it --rm --name tomcatapp-8.5.31 -p 10022:22 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:tomcatapp-8.5.31 "" 28 | docker run -it --rm --name tomcatapp-8.5.31 -p 18080:8080 -p 10001:10001 -p 10002:10002 ${DOCKER_REPOSTORY}/${DOCKER_PROJECT}/${DOCKER_IMAGE}:tomcatapp-8.5.31 "/data/myapp/bin/wrapper-console-start.sh" 29 | -------------------------------------------------------------------------------- /docker-alpine/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 清除已有的 4 | 5 | # 重新生成 6 | sudo docker build -t="yunai/alpine" . -------------------------------------------------------------------------------- /docker-alpine/push.txt: -------------------------------------------------------------------------------- 1 | # push 2 | docker push myharbor.com/base/alpine:sshd 3 | docker push myharbor.com/base/alpine:java-1.8 4 | docker push myharbor.com/base/alpine:java-1.8.181 5 | docker push myharbor.com/base/alpine:singleapp-1.0 6 | docker push myharbor.com/base/alpine:singleapp-1.0.2 7 | docker push myharbor.com/base/alpine:tomcatapp-8.0 8 | docker push myharbor.com/base/alpine:tomcatapp-8.0.52 9 | docker push myharbor.com/base/alpine:tomcatapp-8.5 10 | docker push myharbor.com/base/alpine:tomcatapp-8.5.31 11 | -------------------------------------------------------------------------------- /docker-apache/docker-apache-php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:trusty 2 | MAINTAINER chunyuan Zhang 3 | 4 | # Install base packages 5 | RUN apt-get update && \ 6 | DEBIAN_FRONTEND=noninteractive apt-get -yq install \ 7 | curl \ 8 | apache2 \ 9 | libapache2-mod-php5 \ 10 | php5-mysql \ 11 | php5-mcrypt \ 12 | php5-gd \ 13 | php5-curl \ 14 | php-pear \ 15 | php-apc && \ 16 | rm -rf /var/lib/apt/lists/* && \ 17 | curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer 18 | RUN /usr/sbin/php5enmod mcrypt 19 | RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf && \ 20 | sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini 21 | 22 | ENV ALLOW_OVERRIDE **False** 23 | 24 | # Add image configuration and scripts 25 | ADD run.sh /run.sh 26 | RUN chmod 755 /*.sh 27 | 28 | # Configure /app folder with sample app 29 | RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html 30 | ADD sample/ /app 31 | 32 | EXPOSE 80 33 | WORKDIR /app 34 | CMD ["/run.sh"] 35 | -------------------------------------------------------------------------------- /docker-apache/docker-apache-php/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chown www-data:www-data /app -R 3 | 4 | if [ "$ALLOW_OVERRIDE" = "**False**" ]; then 5 | unset ALLOW_OVERRIDE 6 | else 7 | sed -i "s/AllowOverride None/AllowOverride All/g" /etc/apache2/apache2.conf 8 | a2enmod rewrite 9 | fi 10 | 11 | source /etc/apache2/envvars 12 | tail -F /var/log/apache2/* & 13 | exec apache2 -D FOREGROUND 14 | -------------------------------------------------------------------------------- /docker-apache/docker-apache-php/sample/index.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Hello world! 4 | 5 | 16 | 17 | 18 | 19 |

20 |

My hostname is

21 | 22 | 23 | -------------------------------------------------------------------------------- /docker-apache/docker-apache-php/sample/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-apache/docker-apache-php/sample/logo.png -------------------------------------------------------------------------------- /docker-compose/docker-compose-list/README.md: -------------------------------------------------------------------------------- 1 | # docker-compose-list 2 | 使用docker搭建 zookeeper 集群 ,rabbitmq集群,redis集群,ELK集群,elasticsearch集群。 -------------------------------------------------------------------------------- /docker-compose/docker-compose-mnpr/README.md: -------------------------------------------------------------------------------- 1 | 2 | 安装docker-compose 3 | https://docs.docker.com/compose/install/#install-compose 4 | 5 | ``` 6 | sudo curl -L https://github.com/docker/compose/releases/download/1.21.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose 7 | sudo chmod +x /usr/local/bin/docker-compose 8 | ``` 9 | 10 | docker-compose up 错误处理 11 | ``` 12 | ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running? 13 | 14 | If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. 15 | ``` 16 | 17 | 解决办法 18 | ``` 19 | # sudo vim /etc/default/docker 20 | 21 | 增加 DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock" 22 | 23 | # sudo service docker restart 24 | 25 | 设置 DOCKER_HOST 环境变量,可以添加到 ~/.bashrc 文件中 26 | 27 | # sudo vim ~/.bashrc 28 | 29 | 增加 export DOCKER_HOST=tcp://localhost:4243 30 | 31 | # source ~/.bashrc 32 | 33 | ``` 34 | 35 | 36 | 学习使用 docker-compose 运行 php+nginx+mysql 环境 37 | 38 | 自动创建MYSQL导入MYSQL数据 39 | 40 | 运行 41 | ``` 42 | docker-compose build # build dockerfile 43 | docker-compose up # 构建启动 -d 后台运行 44 | docker-compose start # 启动 45 | docker-compose stop # 停止 46 | docker-compose restart # 重启 47 | docker-compose down # 清除 48 | ``` 49 | 50 | 访问 51 | ``` 52 | http://127.0.0.1:8080/ 53 | ``` 54 | 55 | mysql访问 56 | ``` 57 | mysql -h 127.0.0.1 -P3306 -uroot -p123456 58 | ``` 59 | 60 | redis访问 61 | ``` 62 | redis-cli -h 127.0.0.1 -p 6379 63 | ``` -------------------------------------------------------------------------------- /docker-compose/docker-compose-mnpr/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "2" 2 | 3 | services: 4 | 5 | mysql: 6 | build: mysql 7 | container_name: mysql 8 | restart: always 9 | ports: 10 | - 3306:3306 11 | environment: 12 | MYSQL_ROOT_PASSWORD: 123456 13 | 14 | redis: 15 | image: redis:3.2-alpine 16 | container_name: redis 17 | restart: always 18 | ports: 19 | - 6379:6379 20 | 21 | nginx: 22 | image: nginx:1.12-alpine 23 | container_name: nginx 24 | restart: always 25 | privileged: true 26 | ports: 27 | - 8080:80 28 | volumes: 29 | - ./:/data/wwwroot 30 | - ./nginx/conf.d:/etc/nginx/conf.d 31 | links: 32 | - php 33 | 34 | php: 35 | image: php:5.6-fpm-alpine 36 | restart: always 37 | container_name: php 38 | volumes: 39 | - ./:/data/wwwroot 40 | links: 41 | - mysql 42 | - redis -------------------------------------------------------------------------------- /docker-compose/docker-compose-mnpr/index.html: -------------------------------------------------------------------------------- 1 | html -------------------------------------------------------------------------------- /docker-compose/docker-compose-mnpr/index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | LABEL 基于7.1.19-fpm-alpine3.7构建的PHP环境;安装了pdo pdo_mysql bcmath gd zip bz2(如果需要ffmpeg,可以取消注释) 6 | LABEL 添加swoole扩展 7 | 8 | RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ 9 | #&& apk add --no-cache ffmpeg \ 10 | && apk add --no-cache libpng-dev \ 11 | #&& apk add --no-cache gcc \ 12 | #&& apk add --no-cache make \ 13 | #&& apk add --no-cache autoconf \ 14 | #&& apk add --no-cache pcre \ 15 | && pecl install -o -f redis-4.0.1 \ 16 | && rm -rf /tmp/pear \ 17 | && apk del .phpize-deps \ 18 | && docker-php-ext-enable redis \ 19 | && docker-php-ext-install pdo pdo_mysql bcmath gd zip 20 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/README.md: -------------------------------------------------------------------------------- 1 | #### 基于Docker搭建的lnmp开发环境 2 | 3 | > 包含组件:nginx-1.15.0、MySQL-5.7.22、PHP-7.1.19-fpm、Redis-4.0.10 4 | > 5 | > Nginx、PHP、Redis使用的是Alpine-3.7 6 | > 另外,由于搭建此环境时,有用到FFmpeg,所以PHP的镜像中,默认集成了FFmpeg; 7 | > 8 | > 各个容器的配置信息都在conf目录下相应的目录中,可以根据需要进行调整; 9 | 10 | 11 | ----- 12 | 13 | 14 | #### 重要提示 15 | 16 | >在PHP项目中,MySQL和Redis的配置路径及端口号,不再是`localhost`和`127.0.0.1`,而是`docker-compose.yml`中设定的service的名称。在此`docker-compose.yml`中,分别是`mysql`和`redis`。 17 | > 18 | >MySQL的账号、密码、自动创建的数据库也都在`docker-compose.yml`中: 19 | > 20 | > ``` 21 | > environment: 22 | > - MYSQL_ROOT_PASSWORD=root 23 | > - MYSQL_DATABASE=lumen 24 | > ``` 25 | > 26 | > * 另:`docker.cmd`文件中记录的是搭建环境和平时使用时,经常用到的docker相关的命令; 27 | 28 | ----- 29 | 30 | #### 更新记录 31 | 32 | > - 2018-08-29 加入了根据自身需求构建镜像`image`的临时文件`Dockerfile` 33 | > - 2018-08-28 `LNMP On Docker`开发过程中,在 Windows 或 macOS 上响应速度很慢。在此次更新中进行了优化,即在`volumes`映射时,加入了`:cached`,若为`linux`则无需此项;参考文档: 34 | > 1. [How to get a better disk performance in Docker for Mac](https://medium.com/@TomKeur/how-get-better-disk-performance-in-docker-for-mac-2ba1244b5b70) 35 | > 2. [Frequently asked questions (FAQ)](https://docs.docker.com/docker-for-mac/faqs/#qcow2-or-raw) 36 | 37 |
38 |
39 |
40 |
41 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/mysql/mysql.cnf: -------------------------------------------------------------------------------- 1 | [mysqld] 2 | 3 | user = mysql 4 | datadir = /var/lib/mysql 5 | skip-external-locking 6 | 7 | key_buffer_size = 16M 8 | max_allowed_packet = 16M 9 | thread_stack = 192K 10 | thread_cache_size = 8 11 | 12 | query_cache_limit = 1M 13 | query_cache_size = 16M 14 | 15 | expire_logs_days = 10 16 | max_binlog_size = 100M 17 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/nginx/default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name localhost; 4 | 5 | #charset koi8-r; 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html/mina/public; 10 | index index.html index.htm index.php; 11 | try_files $uri $uri/ /index.php?$query_string; 12 | } 13 | 14 | #error_page 404 /404.html; 15 | 16 | # redirect server error pages to the static page /50x.html 17 | # 18 | error_page 500 502 503 504 /50x.html; 19 | location = /50x.html { 20 | root /usr/share/nginx/html; 21 | } 22 | 23 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 24 | # 25 | #location ~ \.php$ { 26 | # proxy_pass http://127.0.0.1; 27 | #} 28 | 29 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 30 | # 31 | location ~ \.php$ { 32 | root /usr/share/nginx/html/mina/public; 33 | fastcgi_pass php:9000; 34 | fastcgi_index index.php; 35 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 36 | include fastcgi_params; 37 | } 38 | 39 | # deny access to .htaccess files, if Apache's document root 40 | # concurs with nginx's one 41 | # 42 | #location ~ /\.ht { 43 | # deny all; 44 | #} 45 | } 46 | 47 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/nginx/new.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name new.com; 4 | 5 | #charset koi8-r; 6 | #access_log /var/log/nginx/host.access.log main; 7 | 8 | location / { 9 | root /usr/share/nginx/html; 10 | index index.html index.htm index.php; 11 | try_files $uri $uri/ /index.php?$query_string; 12 | } 13 | 14 | #error_page 404 /404.html; 15 | 16 | # redirect server error pages to the static page /50x.html 17 | # 18 | error_page 500 502 503 504 /50x.html; 19 | location = /50x.html { 20 | root /usr/share/nginx/html; 21 | } 22 | 23 | # proxy the PHP scripts to Apache listening on 127.0.0.1:80 24 | # 25 | #location ~ \.php$ { 26 | # proxy_pass http://127.0.0.1; 27 | #} 28 | 29 | # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 30 | # 31 | location ~ \.php$ { 32 | root /usr/share/nginx/html; 33 | fastcgi_pass php:9000; 34 | fastcgi_index index.php; 35 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 36 | include fastcgi_params; 37 | } 38 | 39 | # deny access to .htaccess files, if Apache's document root 40 | # concurs with nginx's one 41 | # 42 | #location ~ /\.ht { 43 | # deny all; 44 | #} 45 | } 46 | 47 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/nginx/upload.conf: -------------------------------------------------------------------------------- 1 | client_max_body_size 80m; 2 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/php/docker-php-ext-pdo_mysql.ini: -------------------------------------------------------------------------------- 1 | extension=pdo_mysql.so 2 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/php/docker-php-ext-redis.ini: -------------------------------------------------------------------------------- 1 | extension=redis.so 2 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/php/exts.ini: -------------------------------------------------------------------------------- 1 | extension=bcmath.so; 2 | extension=gd.so; 3 | extension=zip.so; 4 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/conf/php/upload-setting.ini: -------------------------------------------------------------------------------- 1 | post_max_size=1024M 2 | upload_max_filesize=1024M 3 | upload_tmp_dir=/tmp 4 | max_execution_time=300 5 | -------------------------------------------------------------------------------- /docker-compose/docker-compose/html/mina/.env.example: -------------------------------------------------------------------------------- 1 | APP_ENV=local 2 | APP_DEBUG=true 3 | APP_KEY= 4 | APP_TIMEZONE=Asia/Shanghai 5 | 6 | # DINGO API 7 | API_VERSION=v1 8 | API_NAME=lumen-api-demo 9 | # 后缀,和域名应该只有一个 10 | # 打开后访问xxx.com/api/foos 11 | API_PREFIX=api 12 | #API_DOMAIN=www.lumen.com 13 | API_STANDARDS_TREE=vnd 14 | API_SUBTYPE=lumen 15 | API_DEBUG=true 16 | 17 | # JWT 18 | JWT_SECRET= 19 | # token 过期时间为 默认1小时,根据自己需要配置 20 | # JWT_TTL= 21 | # JWT_REFRESH_TTL= 22 | 23 | # mysql 24 | DB_HOST=127.0.0.1 25 | DB_DATABASE=lumen 26 | DB_PORT=3307 # 本地环境(容器外)会使用这个端口;容器中,会使用docker-compose.yml中services的php的端口 27 | DB_USERNAME=homestead 28 | DB_PASSWORD=secret 29 | 30 | CACHE_DRIVER=file 31 | #CACHE_DRIVER=redis 32 | QUEUE_DRIVER=database 33 | 34 | MAIL_DRIVER= 35 | MAILGUN_DOMAIL= 36 | MAILGUN_SECRET= 37 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-app/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tomcat:7.0 2 | MAINTAINER Xusheng Gong 3 | ENV REFRESHED_AT 2016-01-24 4 | 5 | ADD server.xml /usr/local/tomcat/conf/server.xml 6 | CMD ["catalina.sh", "run"] 7 | 8 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-build/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM maven:3.3-jdk-7 2 | MAINTAINER Xusheng Gong 3 | ENV REFRESHED_AT 2016-01-24 4 | RUN curl -fSL https://github.com/knightliao/disconf/archive/2.6.30.zip -o 2.6.30.zip 5 | RUN unzip 2.6.30.zip 6 | ENV ONLINE_CONFIG_PATH /home/work/dsp/disconf-rd/online-resources 7 | ENV WAR_ROOT_PATH /home/work/dsp/disconf-rd/working/war 8 | RUN cd disconf-2.6.30/disconf-web 9 | VOLUME /home/work/dsp/disconf-rd/online-resources 10 | VOLUME /home/work/dsp/disconf-rd/working 11 | WORKDIR disconf-2.6.30/disconf-web 12 | CMD ["sh", "deploy/deploy.sh"] 13 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-build/config/application.properties: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # \u670d\u52a1\u5668\u7684domain 4 | # 5 | 6 | domain=disconf.com 7 | 8 | # 9 | # \u90ae\u7bb1\u8bbe\u7f6e 10 | # 11 | 12 | EMAIL_MONITOR_ON = true 13 | EMAIL_HOST = smtp.163.com 14 | EMAIL_HOST_PASSWORD = password 15 | EMAIL_HOST_USER = sender@163.com 16 | EMAIL_PORT = 25 17 | DEFAULT_FROM_EMAIL = disconf@163.com 18 | 19 | # 20 | # \u5b9a\u65f6\u6821\u9a8c\u4e2d\u5fc3\u7684\u914d\u7f6e\u4e0e\u6240\u6709\u5ba2\u6237\u7aef\u914d\u7f6e\u7684\u4e00\u81f4\u6027 21 | # 22 | CHECK_CONSISTENCY_ON= true -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-build/config/jdbc-mysql.properties: -------------------------------------------------------------------------------- 1 | jdbc.driverClassName=com.mysql.jdbc.Driver 2 | 3 | jdbc.db_0.url=jdbc:mysql://disconf-mysql:3306?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull\ 4 | &rewriteBatchedStatements=false 5 | jdbc.db_0.username=root 6 | jdbc.db_0.password=passw0rd 7 | 8 | jdbc.maxPoolSize=20 9 | jdbc.minPoolSize=10 10 | jdbc.initialPoolSize=10 11 | jdbc.idleConnectionTestPeriod=1200 12 | jdbc.maxIdleTime=3600 13 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-build/config/redis-config.properties: -------------------------------------------------------------------------------- 1 | redis.group1.retry.times=2 2 | 3 | redis.group1.client1.name=BeidouRedis1 4 | redis.group1.client1.host=disconf-redis 5 | redis.group1.client1.port=6379 6 | redis.group1.client1.timeout=5000 7 | redis.group1.client1.password=foobared 8 | 9 | redis.group1.client2.name=BeidouRedis2 10 | redis.group1.client2.host=disconf-redis 11 | redis.group1.client2.port=6380 12 | redis.group1.client2.timeout=5000 13 | redis.group1.client2.password=foobared 14 | 15 | redis.evictor.delayCheckSeconds=300 16 | redis.evictor.checkPeriodSeconds=30 17 | redis.evictor.failedTimesToBeTickOut=6 18 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-build/config/zoo.properties: -------------------------------------------------------------------------------- 1 | 2 | hosts=disconf-zoo:2181 3 | 4 | # zookeeper\u7684\u524d\u7f00\u8def\u5f84\u540d 5 | zookeeper_url_prefix=/disconf 6 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | disconf-redis: 2 | image: redis:3.0 3 | disconf-mysql: 4 | image: mysql:5.7 5 | volumes: 6 | - ../disconf-mysql/files/sql:/docker-entrypoint-initdb.d 7 | - ../disconf-mysql/data:/var/lib/mysql 8 | environment: 9 | - MYSQL_ROOT_PASSWORD=passw0rd 10 | disconf-zoo: 11 | build: ../disconf-zoo 12 | ports: 13 | - "2181:2181" 14 | disconf-app: 15 | build: ../disconf-app 16 | links: 17 | - disconf-redis 18 | - disconf-mysql 19 | - disconf-zoo 20 | volumes: 21 | - ../disconf-build/working/war:/home/work/dsp/disconf-rd/war 22 | disconf-nginx: 23 | image: nginx:1.9 24 | links: 25 | - disconf-app 26 | volumes: 27 | - ../disconf-nginx/nginx.conf:/etc/nginx/nginx.conf:ro 28 | - ../disconf-build/working/war/html:/home/work/dsp/disconf-rd/war/html:ro 29 | - ../disconf-nginx/logs:/home/work/var/logs/disconf 30 | ports: 31 | - "8081:8081" 32 | 33 | 34 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-mysql/files/sql/.gitignore: -------------------------------------------------------------------------------- 1 | /20150301 2 | /20150420 -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-mysql/files/sql/5-20150101-disconf.sql: -------------------------------------------------------------------------------- 1 | use `disconf`; 2 | 3 | INSERT INTO `config` (`config_id`, `type`, `name`, `value`, `app_id`, `version`, `env_id`, `create_time`, `update_time`) 4 | VALUES 5 | (147, 0, 'testJson.json', '{\"message\": {}, \"success\": \"true\"}', 2, '1_0_0_0', 1, '20150121150626', '20150121153650'); 6 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-mysql/files/sql/6-20150320-disconf.sql: -------------------------------------------------------------------------------- 1 | use `disconf`; 2 | 3 | INSERT INTO `config` (`config_id`, `type`, `name`, `value`, `app_id`, `version`, `env_id`, `create_time`, `update_time`) 4 | VALUES 5 | (148, 0, 'autoconfig.properties', 'auto=bbdxxjdccd', 2, '1_0_0_0', 1, '20150320130619', '20150320224956'), 6 | (149, 0, 'autoconfig2.properties', 'auto2=cd', 2, '1_0_0_0', 1, '20150320130625', '20150320203808'); 7 | -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-mysql/files/sql/README.md: -------------------------------------------------------------------------------- 1 | MySQL启动后将依次执行本目录中的SQL以初始化 2 | 3 | From official [MySQL Docker image doc](https://hub.docker.com/_/mysql/): 4 | 5 | When a container is started for the first time, a new database mysql will be initialized with the provided configuration variables. Furthermore, it will execute files with extensions .sh and .sql that are found in /docker-entrypoint-initdb.d. -------------------------------------------------------------------------------- /docker-disconf/DockerDisconf/disconf-zoo/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM java:7-jre 2 | MAINTAINER Xusheng Gong 3 | ENV REFRESHED_AT 2016-01-24 4 | RUN curl -fSL http://apache.fayea.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz -o zookeeper-3.4.6.tar.gz \ 5 | && tar -xzf zookeeper-3.4.6.tar.gz -C /opt \ 6 | && mv /opt/zookeeper-3.4.6 /opt/zookeeper \ 7 | && cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg \ 8 | && mkdir -p /tmp/zookeeper 9 | 10 | ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64 11 | 12 | EXPOSE 2181 2888 3888 13 | 14 | WORKDIR /opt/zookeeper 15 | 16 | VOLUME ["/opt/zookeeper/conf", "/tmp/zookeeper"] 17 | 18 | ENTRYPOINT ["/opt/zookeeper/bin/zkServer.sh"] 19 | CMD ["start-foreground"] 20 | -------------------------------------------------------------------------------- /docker-java-web/.gitignore: -------------------------------------------------------------------------------- 1 | .data/ 2 | docker-compose.yml 3 | *.swp 4 | -------------------------------------------------------------------------------- /docker-java-web/README.md: -------------------------------------------------------------------------------- 1 | #docker-java-web 2 | -------------------------------------------------------------------------------- /docker-java-web/build/tomcat/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM tomcat:9 2 | 3 | ADD ./server.xml /usr/local/tomcat/conf/ 4 | 5 | EXPOSE 8080 6 | EXPOSE 8009 7 | 8 | VOLUME "/usr/local/tomcat/webapps" 9 | VOLUME "/usr/local/tomcat/conf" 10 | 11 | WORKDIR /usr/local/tomcat 12 | 13 | 14 | CMD [ "/usr/local/tomcat/bin/catalina.sh" , "run"] 15 | -------------------------------------------------------------------------------- /docker-java-web/docker-compose.yml.temp: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | 5 | db: 6 | image: mysql:5.5 7 | command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci 8 | volumes: 9 | - "./.data/db:/var/lib/mysql" 10 | environment: 11 | MYSQL_ROOT_PASSWORD: root 12 | 13 | redis: 14 | image: redis:3 15 | 16 | tomcat: 17 | build: ./build/tomcat/ 18 | volumes: 19 | - "./.data/webapps:/opt/tomcat/webapps" 20 | links: 21 | - db 22 | - redis 23 | ports: 24 | - "8080:8080" 25 | -------------------------------------------------------------------------------- /docker-java-web/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | docker-compose stop 6 | -------------------------------------------------------------------------------- /docker-java-web/uninstall.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/docker-java-web/uninstall.sh -------------------------------------------------------------------------------- /docker-jdk/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing jdk: Dockerfile for building jdk images 6 | # 7 | FROM aft/centos:7.0 8 | MAINTAINER MR.NI 9 | 10 | ENV JAVA_VERSION 1.7.0 11 | ENV JDK_HOME /usr/lib/jvm/java-1.7.0-openjdk 12 | 13 | # Install jdk 14 | RUN yum -y install java-${JAVA_VERSION}-openjdk java-${JAVA_VERSION}-openjdk-devel && \ 15 | yum clean all 16 | -------------------------------------------------------------------------------- /docker-jira/docker-jira/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | db: 4 | image: mysql:5.6 5 | command: --character-set-server=utf8 --collation-server=utf8_bin 6 | volumes: 7 | - /var/jira/shared/db_data:/var/lib/mysql 8 | - /var/jira/shared/db_logs:/var/log/mysql 9 | restart: always 10 | environment: 11 | MYSQL_ROOT_PASSWORD: myjirarootpwd 12 | MYSQL_DATABASE: jira 13 | MYSQL_USER: jira 14 | MYSQL_PASSWORD: jira 15 | 16 | jira: 17 | depends_on: 18 | - db 19 | image: registry.aliyuncs.com/bansh/jira:latest 20 | volumes: 21 | - /var/jira/shared/jira_data:/var/atlassian/jira 22 | - /var/jira/shared/jira_logs:/opt/atlassian/jira/logs 23 | ports: 24 | - "8090:8080" 25 | restart: always 26 | environment: 27 | DB_HOST: db:3306 28 | DB_PASSWORD: jira -------------------------------------------------------------------------------- /docker-jira/docker-jira/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # check if the `server.xml` file has been changed since the creation of this 4 | # Docker image. If the file has been changed the entrypoint script will not 5 | # perform modifications to the configuration file. 6 | if [ "$(stat --format "%Y" "${JIRA_INSTALL}/conf/server.xml")" -eq "0" ]; then 7 | if [ -n "${X_PROXY_NAME}" ]; then 8 | xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8080"]' --type "attr" --name "proxyName" --value "${X_PROXY_NAME}" "${JIRA_INSTALL}/conf/server.xml" 9 | fi 10 | if [ -n "${X_PROXY_PORT}" ]; then 11 | xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8080"]' --type "attr" --name "proxyPort" --value "${X_PROXY_PORT}" "${JIRA_INSTALL}/conf/server.xml" 12 | fi 13 | if [ -n "${X_PROXY_SCHEME}" ]; then 14 | xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8080"]' --type "attr" --name "scheme" --value "${X_PROXY_SCHEME}" "${JIRA_INSTALL}/conf/server.xml" 15 | fi 16 | if [ "${X_PROXY_SCHEME}" = "https" ]; then 17 | xmlstarlet ed --inplace --pf --ps --insert '//Connector[@port="8080"]' --type "attr" --name "secure" --value "true" "${JIRA_INSTALL}/conf/server.xml" 18 | xmlstarlet ed --inplace --pf --ps --update '//Connector[@port="8080"]/@redirectPort' --value "${X_PROXY_PORT}" "${JIRA_INSTALL}/conf/server.xml" 19 | fi 20 | if [ -n "${X_PATH}" ]; then 21 | xmlstarlet ed --inplace --pf --ps --update '//Context/@path' --value "${X_PATH}" "${JIRA_INSTALL}/conf/server.xml" 22 | fi 23 | fi 24 | 25 | exec "$@" 26 | -------------------------------------------------------------------------------- /docker-jira/docker-jira/readme.md: -------------------------------------------------------------------------------- 1 | # build 2 | **阿里云image已经删除, 请执行以下命令本地build** 3 | 4 | ```bash 5 | docker build -t registry.aliyuncs.com/bansh/jira:latest . 6 | ``` 7 | 8 | # install 9 | 10 | ### start mysql 11 | 12 | ```bash 13 | docker run -d \ 14 | --name=mysql-db \ 15 | --hostname=mysql-db \ 16 | -e MYSQL_ROOT_PASSWORD=123456 \ 17 | -e MYSQL_DATABASE=jira \ 18 | -e MYSQL_USER=jira \ 19 | -e MYSQL_PASSWORD=jira \ 20 | -v /var/jira/shared/db_data:/var/lib/mysql \ 21 | -e /var/jira/shared/db_logs:/var/log/mysql \ 22 | mysql:5.6 --character-set-server=utf8 --collation-server=utf8_bin 23 | ``` 24 | 25 | ### start jira 26 | 27 | ```bash 28 | docker run -d --publish 8080:8080 \ 29 | --link mysql-db:mysql \ 30 | -v /var/jira/shared/jira_data:/var/atlassian/jira \ 31 | -v /var/jira/shared/jira_logs:/opt/atlassian/jira/logs \ 32 | registry.aliyuncs.com/bansh/jira:latest 33 | ``` 34 | 35 | ### start all 36 | 37 | ```bash 38 | docker-compose up -d 39 | ``` -------------------------------------------------------------------------------- /docker-kafka/docker-kafka/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM anapsix/alpine-java 2 | 3 | #定义kafka版本信息 4 | ARG kafka_version=0.11.0.1 5 | ARG scala_version=2.11 6 | 7 | MAINTAINER Koma 8 | 9 | #设置软件源 10 | RUN echo 'https://mirrors.ustc.edu.cn/alpine/v3.6/community/' > /etc/apk/repositories \ 11 | && echo 'https://mirrors.ustc.edu.cn/alpine/v3.6/main/' >> /etc/apk/repositories 12 | 13 | #设置时区 14 | RUN apk update && apk add tzdata \ 15 | && cp /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime \ 16 | && echo 'Asia/Hong_Kong' > /etc/timezone \ 17 | && apk del tzdata 18 | 19 | RUN apk add --update unzip wget curl docker supervisor 20 | 21 | ENV KAFKA_VERSION=$kafka_version 22 | ENV SCALA_VERSION=$scala_version 23 | 24 | #运行下载kafka脚本并解压到指定文件下 25 | ADD download-kafka.sh /tmp/download-kafka.sh 26 | RUN chmod a+x /tmp/download-kafka.sh \ 27 | && sync && /tmp/download-kafka.sh \ 28 | && tar xzf /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz -C /opt \ 29 | && rm /tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz \ 30 | && ln -s /opt/kafka_${SCALA_VERSION}-${KAFKA_VERSION} /opt/kafka 31 | 32 | VOLUME ["/kafka"] 33 | 34 | ENV KAFKA_HOME /opt/kafka 35 | ENV PATH ${PATH}:${KAFKA_HOME}/bin 36 | 37 | ADD start-kafka.sh /usr/bin/start-kafka.sh 38 | RUN chmod a+x /usr/bin/start-kafka.sh 39 | 40 | ADD supervisord.conf /etc/supervisord.conf 41 | 42 | CMD ["start-kafka.sh"] 43 | -------------------------------------------------------------------------------- /docker-kafka/docker-kafka/README.md: -------------------------------------------------------------------------------- 1 | # 项目说明 2 | 该Docker用于快速部署Kafka,适用于本地开发测试,学习环境,切勿上线使用。 3 | 4 | # 使用帮助 5 | - 启动 Kafka: 6 | ``` 7 | docker-compose up -d 8 | ``` 9 | - 关闭 Kafka: 10 | ``` 11 | docker-compose stop 12 | ``` 13 | - 运行 Kafka 命令:(以显示 topics 列表为例,其它命令请参考:[Kafka Quickstart](http://kafka.apache.org/quickstart)) 14 | ``` 15 | docker exec -it {容器Id} kafka-topics.sh --list --zookeeper localhost:2181 16 | 17 | 说明:这里的 zookeeper 地址写法固定为 localhost:2181,因为这个Docker内部自启动了 zookeeper 不需要外部环境支持 18 | ``` 19 | - Kafka快捷使用脚本 20 | ``` 21 | ./local-kafka-manager.sh 22 | ``` -------------------------------------------------------------------------------- /docker-kafka/docker-kafka/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | kafka: 4 | build: . 5 | ports: 6 | - "9092" 7 | volumes: 8 | - /tmp/kafka:/kafka 9 | -------------------------------------------------------------------------------- /docker-kafka/docker-kafka/download-kafka.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ ! -x "/opt" ];then 4 | mkdir /opt 5 | fi 6 | 7 | mirror="https://mirrors.tuna.tsinghua.edu.cn/apache/" 8 | url="${mirror}kafka/${KAFKA_VERSION}/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" 9 | wget "${url}" -O "/tmp/kafka_${SCALA_VERSION}-${KAFKA_VERSION}.tgz" -------------------------------------------------------------------------------- /docker-kafka/docker-kafka/start-kafka.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /usr/bin/supervisord -c /etc/supervisord.conf 4 | -------------------------------------------------------------------------------- /docker-kafka/docker-kafka/supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file = /tmp/supervisor.sock 3 | 4 | [supervisord] 5 | logfile = /tmp/supervisord.log 6 | logfile_maxbytes = 50MB 7 | logfile_backups=10 8 | loglevel = info 9 | pidfile = /tmp/supervisord.pid 10 | #设置为前台启动 11 | nodaemon = true 12 | minfds = 1024 13 | minprocs = 200 14 | umask = 022 15 | #切换用户为root 16 | user = root 17 | identifier = supervisor 18 | directory = /tmp 19 | nocleanup = true 20 | childlogdir = /tmp 21 | strip_ansi = false 22 | 23 | [supervisorctl] 24 | serverurl = unix:///tmp/supervisor.sock 25 | 26 | [program:zookeeper] 27 | command=zookeeper-server-start.sh /opt/kafka/config/zookeeper.properties 28 | autostart=true 29 | autorestart=true 30 | priority=1 31 | 32 | [program:kafka] 33 | command=kafka-server-start.sh /opt/kafka/config/server.properties 34 | autostart=true 35 | autorestart=true 36 | priority=3 37 | -------------------------------------------------------------------------------- /docker-kafka/docker安装kafka.md: -------------------------------------------------------------------------------- 1 | docker安装kafka 2 | 3 | 4 | 目录 5 | 1.前置条件:先按zookeeper 6 | 2.正题:安装kafka 7 | 3.参数意义 8 | 4.验证kafka是否可以使用 9 | 4.1 进入容器 10 | 4.2 进入路径 11 | 4.3运行kafka生产者发送消息 12 | 4.4 发送消息 13 | 1.前置条件:先按zookeeper 14 | docker run -d --name zookeeper -p 2181:2181 -v /etc/localtime:/etc/localtime wurstmeister/zookeeper 15 | 1 16 | 17 | 18 | 2.正题:安装kafka 19 | docker run -d --name kafka -p 9092:9092 -e KAFKA_BROKER_ID=0 -e KAFKA_ZOOKEEPER_CONNECT=10.9.44.11:2181 -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.9.44.11:9092 -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 -t wurstmeister/kafka 20 | 21 | 1 22 | 2 23 | 3.参数意义 24 | -e KAFKA_BROKER_ID=0 在kafka集群中,每个kafka都有一个BROKER_ID来区分自己 25 | 26 | -e KAFKA_ZOOKEEPER_CONNECT=10.9.44.11:2181/kafka 配置zookeeper管理kafka的路径10.9.44.11:2181/kafka 27 | 28 | -e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://10.9.44.11:9092 把kafka的地址端口注册给zookeeper 29 | 30 | -e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092 配置kafka的监听端口 31 | 32 | -v /etc/localtime:/etc/localtime 容器时间同步虚拟机的时间 33 | 34 | 35 | 36 | 4.验证kafka是否可以使用 37 | 4.1 进入容器 38 | docker exec -it kafka /bin/sh 39 | 1 40 | 4.2 进入路径 41 | cd /opt/kafka_2.11-2.0.0/bin 42 | 43 | 4.3运行kafka生产者发送消息 44 | ./kafka-console-producer.sh --broker-list localhost:9092 --topic sun 45 | 46 | 4.4 发送消息 47 | {“datas”:[{“channel”:"",“metric”:“temperature”,“producer”:“ijinus”,“sn”:“IJA0101-00002245”,“time”:“1543207156000”,“value”:“80”}],“ver”:“1.0”} 48 | 49 | https://www.cnblogs.com/vipsoft/p/13233045.html 50 | ———————————————— 51 | 版权声明:本文为CSDN博主「方方园园」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 52 | 原文链接:https://blog.csdn.net/qq_22041375/article/details/106180415 -------------------------------------------------------------------------------- /docker-mycat/Mycat-Web-国内加速下载.md: -------------------------------------------------------------------------------- 1 | Mycat-Web-国内加速下载[http://nexus.mycat.io/content/groups/public/io/mycat/mycat/Mycat-web/1.0-SNAPSHOT/] 2 | -------------------------------------------------------------------------------- /docker-mycat/MycatLB下载地址.md: -------------------------------------------------------------------------------- 1 | 2 | [https://github.com/coderczp/MycatLB/tree/master/bin] 3 | -------------------------------------------------------------------------------- /docker-mycat/README.md: -------------------------------------------------------------------------------- 1 | Mycat-download 2 | ============== 3 | 由于最近从build服务器发布到github非常慢,所以1.6版本请从以下加速地址下载 4 | 5 | http://dl.mycat.io/1.6-RELEASE/ 6 | -------------------------------------------------------------------------------- /docker-oracle11g/01preinstall/02run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | ###################################################################################### 19 | # docker run [OPTIONS] IMAGE [COMMAND] [ARG...] 20 | # OPTIONS说明: 21 | # -a stdin : 指定标准输入输出内容类型,可选 STDIN/STDOUT/STDERR 三项 22 | # -d : 后台运行容器,并返回容器ID 23 | # -i : 以交互模式运行容器,通常与 -t 同时使用 24 | # -t : 为容器重新分配一个伪输入终端,通常与 -i 同时使用 25 | # --name="nginx-lb" : 为容器指定一个名称 26 | # --dns 8.8.8.8 : 指定容器使用的DNS服务器,默认和宿主一致 27 | # --dns-search example.com : 指定容器DNS搜索域名,默认和宿主一致 28 | # -h "mars" : 指定容器的hostname 29 | # -e username="ritchie" : 设置环境变量 30 | # --env-file=[] : 从指定文件读入环境变量 31 | # --cpuset="0-2" or --cpuset="0,1,2" : 绑定容器到指定CPU运行 32 | # -m : 设置容器使用内存最大值 33 | # --net="bridge" : 指定容器的网络连接类型,支持 bridge/host/none/container: 四种类型 34 | # --link=[] : 添加链接到另一个容器 35 | # --expose=[] : 开放一个端口或一组端口 36 | ###################################################################################### 37 | 38 | # do run 39 | docker run -it \ 40 | --rm \ 41 | --memory=2g \ 42 | --shm-size=2g \ 43 | --name="oracle-11g-ee-preinstall \ 44 | 192.168.8.251/library/oracle-11g-ee:preinstall \ 45 | "bash" 46 | -------------------------------------------------------------------------------- /docker-oracle11g/01preinstall/dockerfile: -------------------------------------------------------------------------------- 1 | FROM 192.168.8.251/library/oraclelinux:7 2 | 3 | RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle && \ 4 | yum -y install oracle-rdbms-server-11gR2-preinstall passwd openssl wget net-tools gettext zip unzip && \ 5 | yum clean all && \ 6 | rm -rf /var/lib/{cache,log} /var/log/lastlog && \ 7 | echo "Create /u01/app dir..." && \ 8 | mkdir -p -m 755 /u01/app/dpdump && \ 9 | mkdir -p -m 755 /u01/app/oradata && \ 10 | mkdir -p -m 755 /u01/app/oraInventory && \ 11 | mkdir -p -m 755 /u01/app/oracle && \ 12 | mkdir -p -m 755 /u01/app/oracle/product/11.2.0/dbhome_1 && \ 13 | chown -R oracle:oinstall /u01 && \ 14 | echo "Delete limits cause of docker limits issue" && \ 15 | cat /etc/security/limits.conf | grep -v oracle | tee /etc/security/limits.conf 16 | 17 | ENV TZ "Asia/Shanghai" 18 | ENV TERM xterm 19 | 20 | WORKDIR /u01/app 21 | -------------------------------------------------------------------------------- /docker-oracle11g/02installed/02run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | ###################################################################################### 19 | # docker run [OPTIONS] IMAGE [COMMAND] [ARG...] 20 | # OPTIONS说明: 21 | # -a stdin : 指定标准输入输出内容类型,可选 STDIN/STDOUT/STDERR 三项 22 | # -d : 后台运行容器,并返回容器ID 23 | # -i : 以交互模式运行容器,通常与 -t 同时使用 24 | # -t : 为容器重新分配一个伪输入终端,通常与 -i 同时使用 25 | # --name="nginx-lb" : 为容器指定一个名称 26 | # --dns 8.8.8.8 : 指定容器使用的DNS服务器,默认和宿主一致 27 | # --dns-search example.com : 指定容器DNS搜索域名,默认和宿主一致 28 | # -h "mars" : 指定容器的hostname 29 | # -e username="ritchie" : 设置环境变量 30 | # --env-file=[] : 从指定文件读入环境变量 31 | # --cpuset="0-2" or --cpuset="0,1,2" : 绑定容器到指定CPU运行 32 | # -m : 设置容器使用内存最大值 33 | # --net="bridge" : 指定容器的网络连接类型,支持 bridge/host/none/container: 四种类型 34 | # --link=[] : 添加链接到另一个容器 35 | # --expose=[] : 开放一个端口或一组端口 36 | ###################################################################################### 37 | 38 | # do run 39 | docker run -it \ 40 | --rm \ 41 | --memory=2g \ 42 | --shm-size=2g \ 43 | --name="oracle-11g-ee-installed \ 44 | 192.168.8.251/library/oracle-11g-ee:installed \ 45 | "bash" 46 | -------------------------------------------------------------------------------- /docker-oracle11g/02installed/assets/colorecho: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ccred='\033[0;31m' 4 | ccgreen='\033[0;32m' 5 | ccyellow='\033[0;33m' 6 | ccblue='\033[0;34m' 7 | ccend='\033[0m' 8 | 9 | echo_red() { 10 | echo -e "${ccred}$@${ccend}" 11 | } 12 | 13 | echo_green() { 14 | echo -e "${ccgreen}$@${ccend}" 15 | } 16 | 17 | echo_yellow() { 18 | echo -e "${ccyellow}$@${ccend}" 19 | } 20 | 21 | echo_blue() { 22 | echo -e "${ccblue}$@${ccend}" 23 | } 24 | -------------------------------------------------------------------------------- /docker-oracle11g/02installed/assets/conf/profile: -------------------------------------------------------------------------------- 1 | export ORACLE_SID=orcl 2 | export ORACLE_UNQNAME=orcl 3 | export ORACLE_BASE=/u01/app/oracle 4 | export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 5 | export ORACLE_INVENTORY=/u01/app/oraInventory 6 | export PATH=/usr/sbin:$PATH 7 | export PATH=$ORACLE_BASE/bin:$PATH 8 | export PATH=$ORACLE_HOME/bin:$PATH 9 | export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib 10 | export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib 11 | export NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS" 12 | export NLS_LANG=AMERICAN_AMERICA.AL32UTF8 13 | export ORACLE_HOME_LISTNER=$ORACLE_HOME 14 | -------------------------------------------------------------------------------- /docker-oracle11g/02installed/assets/db_install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | source /assets/colorecho 6 | 7 | trap "echo_red '******* ERROR: Something went wrong.'; exit 1" SIGTERM 8 | trap "echo_red '******* Caught SIGINT signal. Stopping...'; exit 2" SIGINT 9 | 10 | echo_yellow "" 11 | echo_yellow "Download Oracle Database 11g Install Package" 12 | echo_yellow "Downloading ${INSTALL_ZIP1}" 13 | wget -q -O /home/oracle/oracle_database_112040_Linux-x86-64_1.zip ${INSTALL_ZIP1} 14 | echo_yellow "Downloading ${INSTALL_ZIP2}" 15 | wget -q -O /home/oracle/oracle_database_112040_Linux-x86-64_2.zip ${INSTALL_ZIP2} 16 | 17 | echo_yellow "" 18 | echo_yellow "Unzip Oracle Database 11g Install Package" 19 | unzip -q /home/oracle/oracle_database_112040_Linux-x86-64_1.zip -d /home/oracle 20 | unzip -q /home/oracle/oracle_database_112040_Linux-x86-64_2.zip -d /home/oracle 21 | echo_yellow "" 22 | echo_yellow "Remove Oracle Database 11g Install Package" 23 | rm -rf /home/oracle/oracle_database_*.zip 24 | 25 | echo_yellow "" 26 | echo_yellow "Installing Oracle Database 11g Software Start" 27 | su oracle -c "/home/oracle/database/runInstaller -ignorePrereq -ignoreSysPrereqs -waitforcompletion -silent -responseFile /assets/resp/db_install.rsp 2>&1" 28 | rm -rf /home/oracle/database 29 | 30 | echo_yellow "" 31 | echo_yellow "run /u01/app/oraInventory/orainstRoot.sh" 32 | /u01/app/oraInventory/orainstRoot.sh 33 | 34 | echo_yellow "" 35 | echo_yellow "run /u01/app/oracle/product/11.2.0/dbhome_1/root.sh" 36 | /u01/app/oracle/product/11.2.0/dbhome_1/root.sh 37 | 38 | echo_yellow "" 39 | echo_yellow "Installing Oracle Database 11g Software End" 40 | -------------------------------------------------------------------------------- /docker-oracle11g/02installed/assets/set_profile.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | source /assets/colorecho 6 | 7 | trap "echo_red '******* ERROR: Something went wrong.'; exit 1" SIGTERM 8 | trap "echo_red '******* Caught SIGINT signal. Stopping...'; exit 2" SIGINT 9 | 10 | echo_yellow "" 11 | echo_yellow "Set profile for oracle user" 12 | cat /assets/conf/profile 13 | cat /assets/conf/profile >> /home/oracle/.bash_profile 14 | cat /assets/conf/profile >> /home/oracle/.bashrc 15 | -------------------------------------------------------------------------------- /docker-oracle11g/02installed/dockerfile: -------------------------------------------------------------------------------- 1 | FROM 192.168.8.251/library/oracle-11g-ee:preinstall 2 | 3 | ARG INSTALL_ZIP1=http://192.168.8.100/oracle11g/p13390677_112040_Linux-x86-64_1of7.zip 4 | ARG INSTALL_ZIP2=http://192.168.8.100/oracle11g/p13390677_112040_Linux-x86-64_2of7.zip 5 | 6 | ADD assets /assets 7 | 8 | RUN chmod -R 755 /assets 9 | 10 | RUN /assets/set_profile.sh 11 | 12 | RUN /assets/db_install.sh 13 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/02run.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | # set envirionment 6 | PWD=`pwd` 7 | BASE_DIR="${PWD}" 8 | SOURCE="$0" 9 | while [ -h "$SOURCE" ]; do 10 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 11 | SOURCE="$(readlink "$SOURCE")" 12 | [[ $SOURCE != /* ]] && SOURCE="$BASE_DIR/$SOURCE" 13 | done 14 | BASE_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" 15 | 16 | cd ${BASE_DIR} 17 | 18 | ###################################################################################### 19 | # docker run [OPTIONS] IMAGE [COMMAND] [ARG...] 20 | # OPTIONS说明: 21 | # -a stdin : 指定标准输入输出内容类型,可选 STDIN/STDOUT/STDERR 三项 22 | # -d : 后台运行容器,并返回容器ID 23 | # -i : 以交互模式运行容器,通常与 -t 同时使用 24 | # -t : 为容器重新分配一个伪输入终端,通常与 -i 同时使用 25 | # --name="nginx-lb" : 为容器指定一个名称 26 | # --dns 8.8.8.8 : 指定容器使用的DNS服务器,默认和宿主一致 27 | # --dns-search example.com : 指定容器DNS搜索域名,默认和宿主一致 28 | # -h "mars" : 指定容器的hostname 29 | # -e username="ritchie" : 设置环境变量 30 | # --env-file=[] : 从指定文件读入环境变量 31 | # --cpuset="0-2" or --cpuset="0,1,2" : 绑定容器到指定CPU运行 32 | # -m : 设置容器使用内存最大值 33 | # --net="bridge" : 指定容器的网络连接类型,支持 bridge/host/none/container: 四种类型 34 | # --link=[] : 添加链接到另一个容器 35 | # --expose=[] : 开放一个端口或一组端口 36 | ###################################################################################### 37 | 38 | # do run 39 | docker run -it \ 40 | --rm \ 41 | --memory=2g \ 42 | --shm-size=2g \ 43 | --name="oracle-11g-ee-database" \ 44 | --hostname="database" \ 45 | -e ENABLE_EM="false" \ 46 | -p 1521:1521 \ 47 | -p 1158:1158 \ 48 | 192.168.8.251/library/oracle-11g-ee:database \ 49 | "bash" 50 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/assets/colorecho: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ccred='\033[0;31m' 4 | ccgreen='\033[0;32m' 5 | ccyellow='\033[0;33m' 6 | ccblue='\033[0;34m' 7 | ccend='\033[0m' 8 | 9 | echo_red() { 10 | echo -e "${ccred}$@${ccend}" 11 | } 12 | 13 | echo_green() { 14 | echo -e "${ccgreen}$@${ccend}" 15 | } 16 | 17 | echo_yellow() { 18 | echo -e "${ccyellow}$@${ccend}" 19 | } 20 | 21 | echo_blue() { 22 | echo -e "${ccblue}$@${ccend}" 23 | } 24 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/assets/db_create.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | source /assets/colorecho 6 | 7 | trap "echo_red '******* ERROR: Something went wrong.'; exit 1" SIGTERM 8 | trap "echo_red '******* Caught SIGINT signal. Stopping...'; exit 2" SIGINT 9 | 10 | echo_yellow "" 11 | echo_yellow "Modify /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk" 12 | echo_yellow "在makefile中添加链接libnnz11库的参数,修改/u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk" 13 | echo_yellow "将\$(MK_EMAGENT_NMECTL)修改为:\$(MK_EMAGENT_NMECTL)-lnnz11" 14 | su oracle -c "cp /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk.bak" 15 | su oracle -c "sed -i 's/\$(MK_EMAGENT_NMECTL)/\$(MK_EMAGENT_NMECTL)-lnnz11/g' /u01/app/oracle/product/11.2.0/dbhome_1/sysman/lib/ins_emagent.mk" 16 | 17 | echo_yellow "" 18 | echo_yellow "Create Database Instance Start" 19 | su oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca -silent -responseFile /assets/resp/db_create.rsp" 20 | 21 | echo_yellow "" 22 | echo_yellow "Create Database Instance End" 23 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/assets/db_delete.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | source /assets/colorecho 6 | 7 | trap "echo_red '******* ERROR: Something went wrong.'; exit 1" SIGTERM 8 | trap "echo_red '******* Caught SIGINT signal. Stopping...'; exit 2" SIGINT 9 | 10 | echo_yellow "" 11 | echo_yellow "Delete Database Instance Start" 12 | su oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca -silent -responseFile /assets/resp/db_delete.rsp" 13 | 14 | echo_yellow "" 15 | echo_yellow "Delete Database Instance End" 16 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/assets/net_create.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | source /assets/colorecho 6 | 7 | trap "echo_red '******* ERROR: Something went wrong.'; exit 1" SIGTERM 8 | trap "echo_red '******* Caught SIGINT signal. Stopping...'; exit 2" SIGINT 9 | 10 | echo_yellow "" 11 | echo_yellow "Create Licenser Start" 12 | su oracle -c "/u01/app/oracle/product/11.2.0/dbhome_1/bin/netca -silent -responseFile /assets/resp/net_create.rsp" 13 | 14 | echo_yellow "" 15 | echo_yellow "Create Licenser End" 16 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/assets/resp/em_create.rsp: -------------------------------------------------------------------------------- 1 | SID=orcl 2 | PORT=1521 3 | SYS_PWD=oracle 4 | SYSMAN_PWD=oracle 5 | DBSNMP_PWD=oracle -------------------------------------------------------------------------------- /docker-oracle11g/03database/assets/resp/net_create.rsp: -------------------------------------------------------------------------------- 1 | [GENERAL] 2 | RESPONSEFILE_VERSION="11.2" 3 | CREATE_TYPE="CUSTOM" 4 | [oracle.net.ca] 5 | INSTALLED_COMPONENTS={"server","net8","javavm"} 6 | INSTALL_TYPE=""typical"" 7 | LISTENER_NUMBER=1 8 | LISTENER_NAMES={"LISTENER"} 9 | LISTENER_PROTOCOLS={"TCP;1521"} 10 | LISTENER_START=""LISTENER"" 11 | NAMING_METHODS={"TNSNAMES","ONAMES","HOSTNAME"} 12 | NSN_NUMBER=1 13 | NSN_NAMES={"EXTPROC_CONNECTION_DATA"} 14 | NSN_SERVICE={"PLSExtProc"} 15 | NSN_PROTOCOLS={"TCP;HOSTNAME;1521"} -------------------------------------------------------------------------------- /docker-oracle11g/03database/dockerfile: -------------------------------------------------------------------------------- 1 | FROM 192.168.8.251/library/oracle-11g-ee:installed 2 | 3 | ENV USERNAME="test" 4 | ENV PASSWORD="test" 5 | 6 | ENV ENABLE_EM="false" 7 | 8 | ADD entrypoint.sh /entrypoint.sh 9 | 10 | ADD assets /assets 11 | 12 | RUN chmod -R 755 /assets 13 | 14 | RUN chmod 755 /entrypoint.sh 15 | 16 | RUN /assets/net_create.sh 17 | 18 | RUN /assets/db_create.sh 19 | 20 | EXPOSE 1521 21 | EXPOSE 1158 22 | 23 | VOLUME ["/entrypoint-initdb.d"] 24 | 25 | ENTRYPOINT ["/entrypoint.sh"] 26 | 27 | CMD [""] 28 | -------------------------------------------------------------------------------- /docker-oracle11g/03database/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | 5 | source /assets/colorecho 6 | 7 | chmod 777 /u01/app/dpdump 8 | chown -R oracle:oinstall /u01/app/dpdump 9 | 10 | mkdir -p /u01/app/oradata/orcl/${USERNAME} 11 | chown -R oracle:oinstall /u01/app/oradata/orcl/${USERNAME} 12 | 13 | su oracle -c "/assets/entrypoint_oracle.sh" 14 | -------------------------------------------------------------------------------- /docker-php-fpm/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # MAINTAINER Carson,C.J.Zeong 3 | # DOCKER-VERSION 1.6.2 4 | # 5 | # Dockerizing php-fpm: Dockerfile for building php-fpm images 6 | # 7 | FROM aft/centos:7.0 8 | MAINTAINER MR.NI 9 | 10 | # Set environment variable 11 | ENV APP_DIR /app 12 | 13 | RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs && \ 14 | yum -y install nginx php-cli php-mysql php-pear php-ldap php-mbstring php-soap php-dom php-gd php-xmlrpc php-fpm php-mcrypt && \ 15 | yum clean all 16 | 17 | ADD nginx_nginx.conf /etc/nginx/nginx.conf 18 | ADD nginx_default.conf /etc/nginx/conf.d/default.conf 19 | 20 | ADD php_www.conf /etc/php-fpm.d/www.conf 21 | RUN sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/' /etc/php.ini 22 | 23 | RUN mkdir -p /app && echo "" > ${APP_DIR}/info.php 24 | 25 | EXPOSE 80 443 26 | 27 | ADD supervisor_nginx.conf /etc/supervisor.conf.d/nginx.conf 28 | ADD supervisor_php-fpm.conf /etc/supervisor.conf.d/php-fpm.conf 29 | 30 | ONBUILD ADD . /app 31 | ONBUILD RUN chown -R nginx:nginx /app 32 | -------------------------------------------------------------------------------- /docker-php-fpm/nginx_default.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80 default_server; 3 | server_name localhost; 4 | 5 | #charset koi8-r; 6 | 7 | location / { 8 | root /app; 9 | index index.php index.html index.htm; 10 | } 11 | 12 | # redirect server error pages to the static page /50x.html 13 | # 14 | error_page 500 502 503 504 /50x.html; 15 | location = /50x.html { 16 | root /app; 17 | } 18 | 19 | # Disable nginx log write favicon.ico 20 | location = /favicon.ico { 21 | log_not_found off; 22 | access_log off; 23 | } 24 | 25 | # pass the PHP scripts to FastCGI server listening on port 9000 26 | # 27 | location ~ \.php$ { 28 | root /app; 29 | fastcgi_pass 127.0.0.1:9000; 30 | #fastcgi_pass unix:/tmp/php-fpm.sock; 31 | fastcgi_index index.php; 32 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 33 | include fastcgi_params; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /docker-php-fpm/nginx_nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes 1; 3 | daemon off; 4 | 5 | error_log /var/log/nginx/error.log warn; 6 | pid /var/run/nginx.pid; 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | http { 13 | include /etc/nginx/mime.types; 14 | default_type application/octet-stream; 15 | 16 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 17 | '$status $body_bytes_sent "$http_referer" ' 18 | '"$http_user_agent" "$http_x_forwarded_for"'; 19 | 20 | access_log /var/log/nginx/access.log main; 21 | 22 | sendfile on; 23 | tcp_nopush on; 24 | tcp_nodelay on; 25 | keepalive_timeout 65; 26 | types_hash_max_size 2048; 27 | 28 | gzip on; 29 | gzip_disable "msie6"; 30 | gzip_vary on; 31 | gzip_proxied any; 32 | gzip_comp_level 6; 33 | gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; 34 | 35 | include /etc/nginx/conf.d/*.conf; 36 | } -------------------------------------------------------------------------------- /docker-php-fpm/supervisor_nginx.conf: -------------------------------------------------------------------------------- 1 | [program:nginx] 2 | directory=/ 3 | command=/usr/sbin/nginx -c /etc/nginx/nginx.conf 4 | user=root 5 | autostart=true 6 | autorestart=true 7 | stdout_logfile=/var/log/supervisor/%(program_name)s.log 8 | stderr_logfile=/var/log/supervisor/%(program_name)s.log -------------------------------------------------------------------------------- /docker-php-fpm/supervisor_php-fpm.conf: -------------------------------------------------------------------------------- 1 | [program:php-fpm] 2 | directory=/ 3 | command=/usr/sbin/php-fpm 4 | user=root 5 | autostart=true 6 | autorestart=true 7 | stdout_logfile=/var/log/supervisor/%(program_name)s.log 8 | stderr_logfile=/var/log/supervisor/%(program_name)s.log -------------------------------------------------------------------------------- /elk-docker-compose/.env: -------------------------------------------------------------------------------- 1 | # 设置 ELK 系列软件的版本,docker-compose.yml 文件会自动加载,构建指定版本的镜像. 2 | # 注意:如果您要自定义版本,务必请先做好测试工作,才能投入使用 3 | # 7.13.4 版本使我们严谨测试的发行版本,可直接用于生产环境 4 | ELK_VERSION = 7.13.4 -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/config/elasticsearch.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/elk-docker-compose/elasticsearch/config/elasticsearch.keystore -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/config/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | cluster.name: "docker-cluster" 2 | network.host: 0.0.0.0 3 | -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/config/role_mapping.yml: -------------------------------------------------------------------------------- 1 | # Role mapping configuration file which has elasticsearch roles as keys 2 | # that map to one or more user or group distinguished names 3 | 4 | #roleA: this is an elasticsearch role 5 | # - groupA-DN this is a group distinguished name 6 | # - groupB-DN 7 | # - user1-DN this is the full user distinguished name 8 | 9 | #power_user: 10 | # - "cn=admins,dc=example,dc=com" 11 | #user: 12 | # - "cn=users,dc=example,dc=com" 13 | # - "cn=admins,dc=example,dc=com" 14 | # - "cn=John Doe,cn=other users,dc=example,dc=com" 15 | -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/config/roles.yml: -------------------------------------------------------------------------------- 1 | # The default roles file is empty as the preferred method of defining roles is 2 | # through the API/UI. File based roles are useful in error scenarios when the 3 | # API based roles may not be available. 4 | -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/config/users: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/elk-docker-compose/elasticsearch/config/users -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/config/users_roles: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/elk-docker-compose/elasticsearch/config/users_roles -------------------------------------------------------------------------------- /elk-docker-compose/elasticsearch/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/elk-docker-compose/elasticsearch/data/.gitkeep -------------------------------------------------------------------------------- /elk-docker-compose/kibana/config/kibana.yml: -------------------------------------------------------------------------------- 1 | # 2 | # ** THIS IS AN AUTO-GENERATED FILE ** 3 | # 4 | i18n.locale: "zh-CN" 5 | xpack.spaces.enabled: false 6 | 7 | # Default Kibana configuration for docker target 8 | server.name: kibana 9 | server.host: "0" 10 | elasticsearch.hosts: [ "http://elasticsearch:9200" ] 11 | monitoring.ui.container.elasticsearch.enabled: true 12 | -------------------------------------------------------------------------------- /elk-docker-compose/kibana/config/node.options: -------------------------------------------------------------------------------- 1 | ## Node command line options 2 | ## See `node --help` and `node --v8-options` for available options 3 | ## Please note you should specify one option per line 4 | 5 | ## max size of old space in megabytes 6 | #--max-old-space-size=4096 7 | -------------------------------------------------------------------------------- /elk-docker-compose/logstash/config/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | name = LogstashPropertiesConfig 3 | 4 | appender.console.type = Console 5 | appender.console.name = plain_console 6 | appender.console.layout.type = PatternLayout 7 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c]%notEmpty{[%X{pipeline.id}]}%notEmpty{[%X{plugin.id}]} %m%n 8 | 9 | appender.json_console.type = Console 10 | appender.json_console.name = json_console 11 | appender.json_console.layout.type = JSONLayout 12 | appender.json_console.layout.compact = true 13 | appender.json_console.layout.eventEol = true 14 | 15 | rootLogger.level = ${sys:ls.log.level} 16 | rootLogger.appenderRef.console.ref = ${sys:ls.log.format}_console 17 | -------------------------------------------------------------------------------- /elk-docker-compose/logstash/config/logstash-sample.conf: -------------------------------------------------------------------------------- 1 | # Sample Logstash configuration for creating a simple 2 | # Beats -> Logstash -> Elasticsearch pipeline. 3 | 4 | input { 5 | beats { 6 | port => 5044 7 | } 8 | } 9 | 10 | output { 11 | elasticsearch { 12 | hosts => ["http://localhost:9200"] 13 | index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}" 14 | #user => "elastic" 15 | #password => "changeme" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /elk-docker-compose/logstash/config/logstash.yml: -------------------------------------------------------------------------------- 1 | http.host: "0.0.0.0" 2 | xpack.monitoring.enabled: true 3 | xpack.monitoring.elasticsearch.hosts: [ "http://elasticsearch:9200" ] 4 | 5 | -------------------------------------------------------------------------------- /elk-docker-compose/logstash/config/pipelines.yml: -------------------------------------------------------------------------------- 1 | # This file is where you define your pipelines. You can define multiple. 2 | # For more information on multiple pipelines, see the documentation: 3 | # https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html 4 | 5 | - pipeline.id: main 6 | path.config: "/usr/share/logstash/pipeline" 7 | -------------------------------------------------------------------------------- /install-docker/.gitattributes: -------------------------------------------------------------------------------- 1 | *.rpm binary 2 | *.deb binary 3 | docker-compose-* binary 4 | -------------------------------------------------------------------------------- /install-docker/.gitignore: -------------------------------------------------------------------------------- 1 | # OS generated files # 2 | ###################### 3 | .DS_Store 4 | .DS_Store? 5 | ._* 6 | .Spotlight-V100 7 | .Trashes 8 | ehthumbs.db 9 | Thumbs.db 10 | *.swp 11 | 12 | 13 | -------------------------------------------------------------------------------- /install-docker/images/hello-world.tar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wujun728/jun_linux/df1b3596140a782a6cc582025dca6f7aa446b603/install-docker/images/hello-world.tar -------------------------------------------------------------------------------- /k3s-yaml/解决部署RKE2或K3S -无法拉取镜像办法.md: -------------------------------------------------------------------------------- 1 | 一、根因 2 | 3 | 1、默认的仓库在docker你懂的。 4 | 5 | 二、修改拉取的仓库前缀 6 | 7 | 1、创建文件 8 | 9 | /etc/rancher/k3s/registries.yaml 10 | 11 | k10-01:~ # cat /etc/rancher/k3s/registries.yaml 12 | mirrors: 13 | docker.io: 14 | endpoint: 15 | - "https://m.daocloud.io" 16 | *填充上即可。 17 | ———————————————— 18 | 19 | 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 20 | 21 | 原文链接:https://blog.csdn.net/weixin_46510209/article/details/143695739 -------------------------------------------------------------------------------- /k8s-chart/README.en.md: -------------------------------------------------------------------------------- 1 | # k8s-chart 2 | 3 | #### Description 4 | {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /k8s-chart/app-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: app-ingress 5 | spec: 6 | ingressClassName: nginx 7 | rules: 8 | - host: app.zw.com 9 | http: 10 | paths: 11 | - path: / 12 | pathType: Prefix 13 | backend: 14 | service: 15 | name: gateway 16 | port: 17 | number: 8080 18 | -------------------------------------------------------------------------------- /k8s-chart/gateway/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /k8s-chart/gateway/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: order 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /k8s-chart/gateway/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "order.fullname" . }} 6 | labels: 7 | {{- include "order.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "order.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | target: 21 | type: Utilization 22 | averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 23 | {{- end }} 24 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 25 | - type: Resource 26 | resource: 27 | name: memory 28 | target: 29 | type: Utilization 30 | averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 31 | {{- end }} 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /k8s-chart/gateway/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "order.fullname" . }} 5 | labels: 6 | {{- include "order.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.httpPort }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | {{- include "order.selectorLabels" . | nindent 4 }} 16 | -------------------------------------------------------------------------------- /k8s-chart/order/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /k8s-chart/order/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: order 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /k8s-chart/order/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "order.fullname" . }} 6 | labels: 7 | {{- include "order.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "order.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | target: 21 | type: Utilization 22 | averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 23 | {{- end }} 24 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 25 | - type: Resource 26 | resource: 27 | name: memory 28 | target: 29 | type: Utilization 30 | averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 31 | {{- end }} 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /k8s-chart/order/templates/secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: {{ .Values.image.secretName }} 5 | type: kubernetes.io/dockerconfigjson 6 | data: 7 | .dockerconfigjson: ewoJImF1dGhzIjogewoJCSIxOTIuMTY4LjYyLjE1MCI6IHsKCQkJImF1dGgiOiAiZEc5clpXNWZaRzlqYTJWeU9sQkZOMFYyUm1kWFpYazJVbHBhWlZsemFqTkpZamRaVUd0d1dtVnZlakUyIgoJCX0KCX0KfQo= 8 | -------------------------------------------------------------------------------- /k8s-chart/order/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "order.fullname" . }} 5 | labels: 6 | {{- include "order.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.port }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | selector: 15 | {{- include "order.selectorLabels" . | nindent 4 }} 16 | -------------------------------------------------------------------------------- /k8s-chart/product/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /k8s-chart/product/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: order 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /k8s-chart/product/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "order.fullname" . }} 6 | labels: 7 | {{- include "order.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "order.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | target: 21 | type: Utilization 22 | averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 23 | {{- end }} 24 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 25 | - type: Resource 26 | resource: 27 | name: memory 28 | target: 29 | type: Utilization 30 | averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 31 | {{- end }} 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /k8s-chart/product/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "order.fullname" . }} 5 | labels: 6 | {{- include "order.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.httpPort }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | - port: {{ .Values.service.grpcPort }} 15 | targetPort: grpc 16 | protocol: TCP 17 | name: grpc 18 | selector: 19 | {{- include "order.selectorLabels" . | nindent 4 }} 20 | -------------------------------------------------------------------------------- /k8s-chart/user/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /k8s-chart/user/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: order 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.0 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | # It is recommended to use it with quotes. 24 | appVersion: "1.16.0" 25 | -------------------------------------------------------------------------------- /k8s-chart/user/templates/hpa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.autoscaling.enabled }} 2 | apiVersion: autoscaling/v2 3 | kind: HorizontalPodAutoscaler 4 | metadata: 5 | name: {{ include "order.fullname" . }} 6 | labels: 7 | {{- include "order.labels" . | nindent 4 }} 8 | spec: 9 | scaleTargetRef: 10 | apiVersion: apps/v1 11 | kind: Deployment 12 | name: {{ include "order.fullname" . }} 13 | minReplicas: {{ .Values.autoscaling.minReplicas }} 14 | maxReplicas: {{ .Values.autoscaling.maxReplicas }} 15 | metrics: 16 | {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} 17 | - type: Resource 18 | resource: 19 | name: cpu 20 | target: 21 | type: Utilization 22 | averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} 23 | {{- end }} 24 | {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} 25 | - type: Resource 26 | resource: 27 | name: memory 28 | target: 29 | type: Utilization 30 | averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} 31 | {{- end }} 32 | {{- end }} 33 | -------------------------------------------------------------------------------- /k8s-chart/user/templates/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ include "order.fullname" . }} 5 | labels: 6 | {{- include "order.labels" . | nindent 4 }} 7 | spec: 8 | type: {{ .Values.service.type }} 9 | ports: 10 | - port: {{ .Values.service.httpPort }} 11 | targetPort: http 12 | protocol: TCP 13 | name: http 14 | - port: {{ .Values.service.grpcPort }} 15 | targetPort: grpc 16 | protocol: TCP 17 | name: grpc 18 | selector: 19 | {{- include "order.selectorLabels" . | nindent 4 }} 20 | -------------------------------------------------------------------------------- /mysql-master-slave-docker-compose/.env: -------------------------------------------------------------------------------- 1 | # 设置 mysql 系列软件的版本,docker-compose.yml 文件会自动加载,构建指定版本的镜像. 2 | MYSQL_VERSION = 8.0.30 3 | -------------------------------------------------------------------------------- /mysql-master-slave-docker-compose/conf/master/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | # 17 | # The MySQL Server configuration file. 18 | # 19 | # For explanations see 20 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 21 | 22 | [mysqld] 23 | pid-file = /var/run/mysqld/mysqld.pid 24 | socket = /var/run/mysqld/mysqld.sock 25 | datadir = /var/lib/mysql 26 | secure-file-priv= NULL 27 | 28 | character-set-server=utf8mb4 29 | collation-server=utf8mb4_general_ci 30 | 31 | #主从同步配置参数 32 | server_id=100 33 | # 设置需要同步的数据库 34 | binlog-do-db=db_ginskeleton 35 | binlog-do-db=mysql 36 | # 设置忽略的数据库,连续指定可以忽略多个数据库 37 | # binlog-ignore-db=mysql 38 | binlog-ignore-db=test 39 | # 二进制日志文件前缀 40 | log-bin=binlog_filename 41 | #主库(master)设置binlog的保留时间为7天 42 | expire_logs_days=7 43 | 44 | # Custom config should go here 45 | !includedir /etc/mysql/conf.d/ 46 | -------------------------------------------------------------------------------- /mysql-master-slave-docker-compose/conf/slave/my.cnf: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; version 2 of the License. 6 | # 7 | # This program is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | # GNU General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU General Public License 13 | # along with this program; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | 16 | # 17 | # The MySQL Server configuration file. 18 | # 19 | # For explanations see 20 | # http://dev.mysql.com/doc/mysql/en/server-system-variables.html 21 | 22 | [mysqld] 23 | pid-file = /var/run/mysqld/mysqld.pid 24 | socket = /var/run/mysqld/mysqld.sock 25 | datadir = /var/lib/mysql 26 | secure-file-priv= NULL 27 | 28 | # 从数据库设置binlog日志关闭 29 | sync_binlog=0 30 | innodb_flush_log_at_trx_commit=0 31 | 32 | character-set-server=utf8mb4 33 | collation-server=utf8mb4_general_ci 34 | 35 | #主从同步配置, 从数据库只需要设置 server_id 即可 36 | server_id=200 37 | 38 | 39 | # Custom config should go here 40 | !includedir /etc/mysql/conf.d/ 41 | -------------------------------------------------------------------------------- /mysql-master-slave-docker-compose/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | # 设置 mysql_master 服务 4 | mysql_master: 5 | image: mysql:${MYSQL_VERSION} 6 | container_name: mysql-master-${MYSQL_VERSION} 7 | environment: 8 | - TZ=Asia/Shanghai 9 | # 配置mysql root 账号密码 10 | - MYSQL_ROOT_PASSWORD=Secret2017~ 11 | command: 12 | --default-authentication-plugin=mysql_native_password 13 | ports: 14 | - "33061:3306" 15 | volumes: 16 | - ./conf/master/my.cnf:/etc/mysql/my.cnf 17 | - /data/project2021/ginskeleton/mysql8_master/data:/var/lib/mysql 18 | - /data/project2021/ginskeleton/mysql8_master/files:/var/lib/mysql-files 19 | restart: "always" 20 | networks: 21 | - mysql-net 22 | ulimits: 23 | nproc: 65535 24 | nofile: 25 | soft: 100000 26 | hard: 200000 27 | # 设置 mysql_slave 服务 28 | mysql_slave: 29 | image: mysql:${MYSQL_VERSION} 30 | container_name: mysql-slave-${MYSQL_VERSION} 31 | environment: 32 | - TZ=Asia/Shanghai 33 | # 配置mysql root 账号密码 34 | - MYSQL_ROOT_PASSWORD=Secret2017~ 35 | command: 36 | --default-authentication-plugin=mysql_native_password 37 | ports: 38 | - "33062:3306" 39 | volumes: 40 | - ./conf/slave/my.cnf:/etc/mysql/my.cnf 41 | - /data/project2021/ginskeleton/mysql8_slave/data:/var/lib/mysql 42 | - /data/project2021/ginskeleton/mysql8_slave/files:/var/lib/mysql-files 43 | restart: "always" 44 | networks: 45 | - mysql-net 46 | ulimits: 47 | nproc: 65535 48 | nofile: 49 | soft: 100000 50 | hard: 200000 51 | networks: 52 | mysql-net: 53 | driver: bridge 54 | -------------------------------------------------------------------------------- /oschina-config/README.md: -------------------------------------------------------------------------------- 1 | **开源中国配置文件目录说明** 2 | 3 | [common] 公用配置文件,每个节点都需要 4 | 5 | [main] 主服务器配置 Tengine 2.1.0 6 | [cdn] CDN 节点配置 Tengine 2.1.0 7 | 8 | [mysql] 主数据库配置 MySQL 5.5.x 9 | [tomcat] Tomcat 运行配置,Tomcat 8.x -------------------------------------------------------------------------------- /oschina-config/common/gzip.conf: -------------------------------------------------------------------------------- 1 | gzip on; 2 | gzip_min_length 1024; 3 | gzip_comp_level 5; 4 | gzip_buffers 8 16k; 5 | gzip_http_version 1.0; 6 | gzip_proxied any; 7 | gzip_types text/plain text/html application/javascript text/javascript application/x-javascript text/css; 8 | gzip_vary on; -------------------------------------------------------------------------------- /oschina-config/common/proxy.conf: -------------------------------------------------------------------------------- 1 | limit_req zone=http burst=20 nodelay; 2 | limit_req_whitelist geo_var_name=white_ip geo_var_value=1; 3 | 4 | proxy_redirect off; 5 | proxy_set_header Host $host; 6 | proxy_set_header X-Real-IP $remote_addr; 7 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 8 | proxy_set_header X-Forwarded-Proto $scheme; 9 | proxy_set_header Accept-Encoding 'gzip'; 10 | client_max_body_size 100m; 11 | client_body_buffer_size 256k; 12 | proxy_connect_timeout 500; 13 | proxy_send_timeout 2000; 14 | proxy_read_timeout 2000; 15 | proxy_ignore_client_abort on; 16 | 17 | proxy_http_version 1.1; 18 | proxy_set_header Upgrade $http_upgrade; 19 | proxy_set_header Connection "upgrade"; 20 | 21 | proxy_buffer_size 128k; 22 | proxy_buffers 4 256k; 23 | proxy_busy_buffers_size 256k; 24 | proxy_temp_file_write_size 256k; -------------------------------------------------------------------------------- /oschina-config/main/deny.conf: -------------------------------------------------------------------------------- 1 | #deny 59.173.12.17; 2 | #allow 192.168.2.8; 3 | #deny all; 4 | #deny 211.151.83.28; 5 | #deny 61.145.230.194; 6 | #deny 183.136.156.13; 7 | #deny 61.135.169.0/24; 8 | #deny 61.135.190.0/24; 9 | #deny 190.1.1.1/8; 10 | #deny 175.1.1.1/8; 11 | #deny 198.1.1.1/8; 12 | #deny 189.1.1.1/8; 13 | #deny 123.121.219.183; 14 | #deny 123.125.71.0/24; 15 | #deny 123.126.0.0/16; 16 | -------------------------------------------------------------------------------- /oschina-config/main/realip.conf: -------------------------------------------------------------------------------- 1 | #### read ips #### 2 | 3 | set_real_ip_from 127.0.0.1; 4 | set_real_ip_from 192.168.2.0/24; 5 | set_real_ip_from 61.145.122.155; 6 | set_real_ip_from 219.136.249.194; 7 | 8 | ###### FS ###### 9 | set_real_ip_from 121.9.213.124; 10 | set_real_ip_from 112.91.155.15; 11 | 12 | ###### GZ ###### 13 | set_real_ip_from 219.136.252.253; 14 | set_real_ip_from 219.135.252.50; 15 | 16 | ###### SH ###### 17 | set_real_ip_from 117.135.138.169; 18 | set_real_ip_from 118.126.10.167; 19 | 20 | ##### ali ###### 21 | #set_real_ip_from 121.199.45.0/24; 22 | set_real_ip_from 112.124.5.74; 23 | set_real_ip_from 112.124.6.10; 24 | 25 | ##### bj ####### 26 | set_real_ip_from 124.202.141.0/24; 27 | -------------------------------------------------------------------------------- /oschina-config/main/robot.conf: -------------------------------------------------------------------------------- 1 | #### bot configuration #### 2 | 3 | location @bots { 4 | limit_req zone=useragenttrack burst=100 nodelay; 5 | include oschina/proxy.conf; 6 | access_log /dev/null; 7 | #access_log logs/robot1.log; 8 | proxy_pass http://bot_backend; 9 | } 10 | -------------------------------------------------------------------------------- /oschina-config/main/upstream.conf: -------------------------------------------------------------------------------- 1 | #### upstream defined #### 2 | 3 | upstream osc_backend { 4 | ip_hash; 5 | #server 192.168.2.8:9082; 6 | server 192.168.2.8:9083; 7 | #server 127.0.0.1:9080; 8 | #server 127.0.0.1:9082; 9 | } 10 | 11 | upstream team_backend { 12 | ip_hash; 13 | #server 192.168.2.8:9442; 14 | server 192.168.2.8:9443; 15 | #server 127.0.0.1:8443; 16 | #server 127.0.0.1:9443; 17 | } 18 | 19 | upstream my_backend { 20 | ip_hash; 21 | #server 192.168.2.8:9442; 22 | server 192.168.2.8:9443; 23 | #server 127.0.0.1:8443; 24 | #server 127.0.0.1:9443; 25 | } 26 | 27 | upstream bot_backend { 28 | server 192.168.2.12:9080; 29 | #server 192.168.2.8:9082 backup; 30 | #server 192.168.2.8:9083 backup; 31 | #server 127.0.0.1:9080; 32 | #server 127.0.0.1:9082; 33 | } 34 | -------------------------------------------------------------------------------- /oschina-config/tomcat/catalina.sh: -------------------------------------------------------------------------------- 1 | # 在 catalina.sh 中加入以下两行 2 | 3 | CATALINA_OPTS="-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true" 4 | JAVA_OPTS="-server -Xms4096m -Xmx4096m" 5 | -------------------------------------------------------------------------------- /oschina-config/tomcat/server.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 11 | 12 | 17 | 18 | 19 | 20 | 21 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /shell/server/aria2c/aria2c-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #chkconfig:35 80 20 3 | #description aria2c.sh 4 | #有配置文件 5 | ulimit -n 10240 6 | ulimit -u 10240 7 | 8 | ########################## 9 | # custom variables start 10 | ########################### 11 | APP_PROG=/usr/bin/aria2c 12 | PID_FILE=/var/run/aria2c-server.pid 13 | CONF=/etc/aria2/aria2.conf 14 | 15 | ########################### 16 | # custom variables end 17 | ########################### 18 | 19 | 20 | source /etc/init.d/functions 21 | 22 | ######################### 23 | # define funcation start 24 | ########################## 25 | start(){ 26 | if [ -f $PID_FILE ] 27 | then 28 | echo 'alread running...' 29 | else 30 | $APP_PROG --conf-path=$CONF -D 31 | echo $! > $PID_FILE 32 | echo_success 33 | fi 34 | } 35 | 36 | stop(){ 37 | if [ -f $PID_FILE ] 38 | then 39 | killproc -p $PID_FILE 40 | rm -f $PID_FILE 41 | echo_success 42 | else 43 | echo 'not running...' 44 | fi 45 | } 46 | 47 | restart(){ 48 | stop 49 | sleep 3 50 | start 51 | } 52 | 53 | status(){ 54 | if [ -f PID_FILE ] 55 | then 56 | echo 'running' 57 | else 58 | echo 'not running' 59 | fi 60 | } 61 | ########################## 62 | # define function end 63 | ########################## 64 | ACTION=$1 65 | case $ACTION in 66 | start) 67 | start 68 | ;; 69 | stop) 70 | stop 71 | ;; 72 | restart) 73 | restart 74 | ;; 75 | status) 76 | status 77 | ;; 78 | *) 79 | echo usage "{start|stop|restart|status}" 80 | ;; 81 | esac -------------------------------------------------------------------------------- /shell/server/frp/frpc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #chkconfig:345 98 02 3 | #description:knity.sh 4 | 5 | ########################### 6 | # custom variables start 7 | ########################### 8 | APP_HOME=/opt/frp 9 | APP_NAME=frpc 10 | PID_FILE=/var/run/$APP_NAME.pid 11 | CMD="$APP_HOME/frpc -c $APP_HOME/frpc.ini" 12 | 13 | ########################### 14 | # custom variables end 15 | ########################### 16 | source /etc/init.d/functions 17 | ########################## 18 | # define funcation start 19 | ########################## 20 | lock_dir=/var/lock/subsys 21 | lock_file=$lock_dir/$APP_NAME 22 | createLockFile(){ 23 | [ -w $lock_dir ] && touch $lock_file 24 | } 25 | 26 | start(){ 27 | if [ -f $PID_FILE ] 28 | then 29 | echo 'alread running...' 30 | else 31 | echo $CMD 32 | nohup $CMD >> /var/log/$APP_NAME.log 2>&1 & 33 | echo $! > $PID_FILE 34 | createLockFile 35 | echo_success 36 | fi 37 | } 38 | 39 | stop(){ 40 | if [ -f $PID_FILE ] 41 | then 42 | killproc -p $PID_FILE 43 | rm -f $PID_FILE 44 | echo_success 45 | else 46 | echo 'not running...' 47 | fi 48 | } 49 | 50 | restart(){ 51 | stop 52 | start 53 | } 54 | 55 | status(){ 56 | cat $PID_FILE 57 | } 58 | 59 | 60 | ########################## 61 | # define function end 62 | ########################## 63 | ACTION=$1 64 | case $ACTION in 65 | start) 66 | start 67 | ;; 68 | stop) 69 | stop 70 | ;; 71 | restart) 72 | restart 73 | ;; 74 | status) 75 | status 76 | ;; 77 | *) 78 | echo usage "{start|stop|restart|status}" 79 | ;; 80 | esac -------------------------------------------------------------------------------- /shell/server/frp/frps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #chkconfig:345 98 02 3 | #description:fps.sh 4 | 5 | ########################### 6 | # custom variables start 7 | ########################### 8 | APP_HOME=/opt/frp 9 | APP_NAME=frp 10 | PID_FILE=/var/run/$APP_NAME.pid 11 | CMD="$APP_HOME/frps -c $APP_HOME/frps.ini" 12 | 13 | ########################### 14 | # custom variables end 15 | ########################### 16 | source /etc/init.d/functions 17 | ########################## 18 | # define funcation start 19 | ########################## 20 | lock_dir=/var/lock/subsys 21 | lock_file=$lock_dir/$APP_NAME 22 | createLockFile(){ 23 | [ -w $lock_dir ] && touch $lock_file 24 | } 25 | 26 | start(){ 27 | if [ -f $PID_FILE ] 28 | then 29 | echo 'alread running...' 30 | else 31 | echo $CMD 32 | nohup $CMD >> /var/log/$APP_NAME.log 2>&1 & 33 | echo $! > $PID_FILE 34 | createLockFile 35 | echo_success 36 | fi 37 | } 38 | 39 | stop(){ 40 | if [ -f $PID_FILE ] 41 | then 42 | killproc -p $PID_FILE 43 | rm -f $PID_FILE 44 | echo_success 45 | else 46 | echo 'not running...' 47 | fi 48 | } 49 | 50 | restart(){ 51 | stop 52 | start 53 | } 54 | 55 | status(){ 56 | cat $PID_FILE 57 | } 58 | 59 | 60 | ########################## 61 | # define function end 62 | ########################## 63 | ACTION=$1 64 | case $ACTION in 65 | start) 66 | start 67 | ;; 68 | stop) 69 | stop 70 | ;; 71 | restart) 72 | restart 73 | ;; 74 | status) 75 | status 76 | ;; 77 | *) 78 | echo usage "{start|stop|restart|status}" 79 | ;; 80 | esac -------------------------------------------------------------------------------- /shell/server/jetty/jetty.services: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=jetty.service 3 | After=network.target 4 | 5 | [Service] 6 | ExecStart=/usr/local/datang/jetty/jetty.sh start 7 | ExecStop=/usr/local/datang/jetty/jetty.sh stop 8 | ExecReload=/usr/local/datang/jetty/jetty.sh restart 9 | Type=forking 10 | PrivateTmp=true 11 | 12 | [Install] 13 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /shell/server/mongodb/mongodb.conf: -------------------------------------------------------------------------------- 1 | dbpath=/usr/local/mongodb/data/db/ 2 | logpath=/usr/local/mongodb/logs/mongodb.log 3 | logappend=true 4 | fork=true 5 | port=27017 6 | nohttpinterface=true 7 | auth=true -------------------------------------------------------------------------------- /shell/server/mongodb/mongodb.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=mongodb 3 | After=network.target remote-fs.target nss-lookup.target 4 | 5 | [Service] 6 | Type=forking 7 | ExecStart=/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/conf/mongodb.conf 8 | ExecStop=/usr/local/mongodb/bin/mongod --config /usr/local/mongodb/conf/mongodb.conf --shutdown 9 | ExecReload=/bin/kill -s HUP $MAINPID 10 | PrivateTmp=true 11 | 12 | [Install] 13 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /shell/server/nginx/nginx.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=nginx 3 | After=network.target 4 | [Service] 5 | ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf 6 | ExecStop=/usr/local/nginx/sbin/nginx -s stop 7 | ExecReload=/usr/local/nginx/sbin/nginx -s reload 8 | Type=forking 9 | PrivateTmp=true 10 | [Install] 11 | WantedBy=multi-user.targe -------------------------------------------------------------------------------- /shell/server/tomcat/7.0.82/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | os400=false 3 | case "`uname`" in 4 | OS400*) os400=true;; 5 | esac 6 | 7 | # resolve links - $0 may be a softlink 8 | PRG="$0" 9 | 10 | while [ -h "$PRG" ] ; do 11 | ls=`ls -ld "$PRG"` 12 | link=`expr "$ls" : '.*-> \(.*\)$'` 13 | if expr "$link" : '/.*' > /dev/null; then 14 | PRG="$link" 15 | else 16 | PRG=`dirname "$PRG"`/"$link" 17 | fi 18 | done 19 | 20 | PRGDIR=`dirname "$PRG"` 21 | EXECUTABLE=catalina.sh 22 | 23 | # Check that target executable exists 24 | if $os400; then 25 | # -x will Only work on the os400 if the files are: 26 | # 1. owned by the user 27 | # 2. owned by the PRIMARY group of the user 28 | # this will not work if the user belongs in secondary groups 29 | eval 30 | else 31 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 32 | echo "Cannot find $PRGDIR/$EXECUTABLE" 33 | echo "The file is absent or does not have execute permission" 34 | echo "This file is needed to run this program" 35 | exit 1 36 | fi 37 | fi 38 | 39 | exec "$PRGDIR"/"$EXECUTABLE" start "$@" 40 | 41 | -------------------------------------------------------------------------------- /shell/server/tomcat/GetAppHome.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | PRG="$0" 3 | while [ -h "$PRG" ] ; do 4 | ls=`ls -ld "$PRG"` 5 | link=`expr "$ls" : '.*-> \(.*\)$'` 6 | if expr "$link" : '/.*' > /dev/null; then 7 | PRG="$link" 8 | else 9 | PRG=`dirname "$PRG"`/"$link" 10 | fi 11 | done 12 | PRGDIR=`dirname "$PRG"` 13 | 14 | -------------------------------------------------------------------------------- /shell/server/tomcat/startup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Better OS/400 detection: see Bugzilla 31132 4 | os400=false 5 | case "`uname`" in 6 | OS400*) 7 | os400=true 8 | ;; 9 | esac 10 | 11 | # resolve links - $0 may be a softlink 12 | PRG="$0" 13 | 14 | while [ -h "$PRG" ] ; do 15 | ls=`ls -ld "$PRG"` 16 | link=`expr "$ls" : '.*-> \(.*\)$'` 17 | if expr "$link" : '/.*' > /dev/null; then 18 | PRG="$link" 19 | else 20 | PRG=`dirname "$PRG"`/"$link" 21 | fi 22 | done 23 | 24 | PRGDIR=`dirname "$PRG"` 25 | EXECUTABLE=catalina.sh 26 | 27 | # Check that target executable exists 28 | if $os400; then 29 | # -x will Only work on the os400 if the files are: 30 | # 1. owned by the user 31 | # 2. owned by the PRIMARY group of the user 32 | # this will not work if the user belongs in secondary groups 33 | eval 34 | else 35 | if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then 36 | echo "Cannot find $PRGDIR/$EXECUTABLE" 37 | echo "The file is absent or does not have execute permission" 38 | echo "This file is needed to run this program" 39 | exit 1 40 | fi 41 | fi 42 | 43 | exec "$PRGDIR"/"$EXECUTABLE" start "$@" -------------------------------------------------------------------------------- /shell/server/xampp/apache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # description: apache of xampp 3 | # chkconfig: - 85 15 4 | 5 | PRG="$0" 6 | while [ -h "$PRG" ] ; do 7 | ls=`ls -ld "$PRG"` 8 | link=`expr "$ls" : '.*-> \(.*\)$'` 9 | if expr "$link" : '/.*' > /dev/null; then 10 | PRG="$link" 11 | else 12 | PRG=`dirname "$PRG"`/"$link" 13 | fi 14 | done 15 | ########################## 16 | # custom variables start 17 | ########################### 18 | #APP_HOME=`dirname "$PRG"` 19 | APP_HOME=/opt/lampp 20 | APP_NAME=`basename "$PRG"` 21 | 22 | ########################### 23 | # custom variables end 24 | ########################### 25 | source /etc/init.d/functions 26 | 27 | ######################### 28 | # define funcation start 29 | ########################## 30 | lock_dir=/var/lock/subsys 31 | lock_file=$lock_dir/$APP_NAME 32 | createLockFile(){ 33 | [ -w $lock_dir ] && touch $lock_file 34 | } 35 | start(){ 36 | $APP_HOME/xampp startapache 37 | createLockFile 38 | echo_success 39 | } 40 | 41 | stop(){ 42 | $APP_HOME/xampp stopapache 43 | echo_success 44 | } 45 | 46 | restart(){ 47 | $APP_HOME/xampp restartapache 48 | } 49 | 50 | status(){ 51 | $APP_HOME/xampp status 52 | } 53 | 54 | 55 | ########################## 56 | # define function end 57 | ########################## 58 | ACTION=$1 59 | case $ACTION in 60 | start) 61 | start 62 | ;; 63 | stop) 64 | stop 65 | ;; 66 | restart) 67 | restart 68 | ;; 69 | status) 70 | status 71 | ;; 72 | *) 73 | echo usage "{start|stop|restart|status}" 74 | ;; 75 | esac --------------------------------------------------------------------------------