├── .gitignore ├── LICENSE ├── README.md ├── alpine ├── 3.11 │ ├── Dockerfile │ └── README.md ├── 3.7 │ ├── Dockerfile │ └── README.md ├── 3.8 │ ├── Dockerfile │ └── README.md ├── 3.9 │ ├── Dockerfile │ └── README.md └── edge │ └── Dockerfile ├── cassandra └── v12 │ └── Dockerfile ├── centos ├── 6 │ └── Dockerfile └── 7 │ └── Dockerfile ├── cerebro ├── 0.8.1 │ ├── Dockerfile │ └── run.sh └── 0.8.3 │ ├── Dockerfile │ └── run.sh ├── elasticstack └── elasticsearch │ └── 6.6.1 │ ├── Dockerfile │ └── run.sh ├── etcd └── 3.2.18 │ ├── Dockerfile │ └── run.sh ├── go └── 1.10 │ └── Dockerfile ├── grafana ├── 4.6.3 │ ├── Dockerfile │ ├── conf │ │ ├── custom.ini │ │ └── defaults.ini │ └── run.sh ├── 5.2.0 │ ├── Dockerfile │ └── run.sh ├── 5.2.2 │ ├── Dockerfile │ └── run.sh └── 5.4.2 │ ├── Dockerfile │ └── run.sh ├── jdk ├── 8u151 │ └── Dockerfile ├── 8u181 │ └── Dockerfile └── 8u212 │ └── Dockerfile ├── jre ├── 1105 │ └── Dockerfile ├── 8u151 │ └── Dockerfile ├── 8u181 │ └── Dockerfile └── 8u232 │ └── Dockerfile ├── kafka └── 2.1.0 │ ├── Dockerfile │ └── log4j.properties ├── maven └── 3.5.2 │ └── Dockerfile ├── mysql ├── 5.6.35 │ ├── Dockerfile │ ├── init-db.sh │ └── run.sh ├── 5.7.21 │ ├── Dockerfile │ ├── init.password.sql │ ├── my.cnf │ └── run.sh ├── 5.7.23 │ ├── Dockerfile │ ├── init.password.sql │ ├── my.cnf │ └── run.sh ├── 5.7.24 │ ├── Dockerfile │ ├── init.password.sql │ ├── my.cnf │ └── run.sh └── 5.7.30 │ ├── Dockerfile │ ├── init.sql │ ├── my.cnf │ └── run.sh ├── nginx ├── 1.12.2 │ ├── Dockerfile │ └── files │ │ ├── etc │ │ └── nginx │ │ │ ├── nginx.conf │ │ │ └── vhosts │ │ │ └── default.conf │ │ └── run.sh └── 1.14.0 │ ├── Dockerfile │ └── files │ ├── etc │ └── nginx │ │ ├── nginx.conf │ │ └── vhosts │ │ └── default.conf │ └── run.sh ├── nodejs ├── 8.11.4 │ └── Dockerfile ├── 8.12.0 │ └── Dockerfile ├── 8.9.3 │ ├── Dockerfile │ └── job.sh └── 9.11.1 │ └── Dockerfile ├── php └── 7.1.17 │ ├── Dockerfile │ └── files │ └── etc │ └── php7 │ ├── php-fpm.conf │ ├── php-fpm.d │ └── www.conf │ └── php.ini ├── postgres └── 10.4-alpine │ └── Dockerfile ├── python ├── 2.7.14 │ ├── Dockerfile │ └── job.sh ├── 3.6.3 │ ├── Dockerfile │ └── job.sh └── 3.6.5-centos │ ├── Dockerfile │ └── job.sh ├── redis ├── 4.0.10 │ ├── Dockerfile │ └── run.sh ├── 4.0.11 │ ├── Dockerfile │ └── run.sh ├── 4.0.12 │ ├── Dockerfile │ ├── redis-sentinel.conf │ └── run.sh ├── 4.0.6 │ ├── Dockerfile │ └── run.sh └── 5.0.7 │ ├── Dockerfile │ ├── init-cluster.sh │ ├── redis-sentinel.conf │ └── run.sh ├── sonarqube ├── 7.0 │ ├── Dockerfile │ └── run.sh └── 7.1 │ ├── Dockerfile │ └── run.sh ├── tensorflow └── 1.11.0 │ └── Dockerfile ├── zipkin └── 2.5.1 │ ├── Dockerfile │ ├── README.md │ └── run.sh └── zookeeper ├── 3.4.10 ├── Dockerfile ├── init-dir.sh ├── user-zookeeper-chown-dir ├── zkGenConfig.sh ├── zkMetrics.sh └── zkOk.sh ├── 3.4.13 ├── Dockerfile ├── init-dir.sh ├── user-zookeeper-chown-dir ├── zkGenConfig.sh ├── zkMetrics.sh └── zkOk.sh └── 3.6.0 ├── Dockerfile ├── run.sh ├── zkMetrics.sh └── zkOk.sh /.gitignore: -------------------------------------------------------------------------------- 1 | .git 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dockerfiles 2 | Dockerfile & kubernetes Yaml Templates 3 | 4 | 5 | ## Dockerfiles 6 | 7 | For automated build at [https://hub.docker.com/u/statemood/](https://hub.docker.com/u/statemood/) 8 | 9 | ## 问题 10 | #### 如有疑问,请创建 [Issue](https://github.com/Statemood/dockerfiles/issues) -------------------------------------------------------------------------------- /alpine/3.11/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Lin Ru, 2018.01.06 3 | # Lin.ru@msn.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM alpine:3.11 10 | 11 | RUN rs="https://mirrors.ustc.edu.cn/alpine/v3.11" && \ 12 | rf="/etc/apk/repositories" && \ 13 | tz="Asia/Shanghai" && \ 14 | echo -e "$rs/main/\n$rs/community/" > $rf && \ 15 | apk update && \ 16 | apk upgrade && \ 17 | apk add curl acl tzdata && \ 18 | cp -rfv /usr/share/zoneinfo/$tz /etc/localtime && \ 19 | echo "$tz" > /etc/timezone && \ 20 | apk del tzdata -------------------------------------------------------------------------------- /alpine/3.11/README.md: -------------------------------------------------------------------------------- 1 | # alpine 2 | 3 | ## Build 4 | 5 | docker build statemood/alpine:3.11 . 6 | 7 | ## Push 8 | 9 | docker push statemood/alpine:3.11 10 | 11 | ## Pull 12 | 13 | docker pull statemood/alpine:3.11 14 | -------------------------------------------------------------------------------- /alpine/3.7/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM docker.io/alpine:3.7 10 | 11 | RUN rs="https://mirrors.ustc.edu.cn/alpine/v3.7" && \ 12 | rf="/etc/apk/repositories" && \ 13 | tz="Asia/Shanghai" && \ 14 | echo "$rs/main/" > $rf && \ 15 | echo "$rs/community/" >> $rf && \ 16 | apk update && \ 17 | apk upgrade && \ 18 | apk add curl acl tzdata && \ 19 | cp -rfv /usr/share/zoneinfo/$tz /etc/localtime && \ 20 | echo "$tz" > /etc/timezone && \ 21 | apk del tzdata -------------------------------------------------------------------------------- /alpine/3.7/README.md: -------------------------------------------------------------------------------- 1 | # alpine 2 | 3 | ## Build 4 | 5 | docker build statemood/alpine:3.7 . 6 | 7 | ## Push 8 | 9 | docker push statemood/alpine:3.7 10 | 11 | ## Pull 12 | 13 | docker pull statemood/alpine:3.7 14 | -------------------------------------------------------------------------------- /alpine/3.8/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM docker.io/alpine:3.8 10 | 11 | RUN rs="https://mirrors.ustc.edu.cn/alpine/v3.8" && \ 12 | rf="/etc/apk/repositories" && \ 13 | tz="Asia/Shanghai" && \ 14 | echo "$rs/main/" > $rf && \ 15 | echo "$rs/community/" >> $rf && \ 16 | apk update && \ 17 | apk upgrade && \ 18 | apk add curl acl tzdata && \ 19 | cp -rfv /usr/share/zoneinfo/$tz /etc/localtime && \ 20 | echo "$tz" > /etc/timezone && \ 21 | apk del tzdata -------------------------------------------------------------------------------- /alpine/3.8/README.md: -------------------------------------------------------------------------------- 1 | # alpine 2 | 3 | ## Build 4 | 5 | docker build statemood/alpine:3.7 . 6 | 7 | ## Push 8 | 9 | docker push statemood/alpine:3.7 10 | 11 | ## Pull 12 | 13 | docker pull statemood/alpine:3.7 14 | -------------------------------------------------------------------------------- /alpine/3.9/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Lin Ru, 2018.01.06 3 | # Lin.Ru@msn.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM alpine:3.9 10 | 11 | RUN rs="https://mirrors.ustc.edu.cn/alpine/v3.9" && \ 12 | rf="/etc/apk/repositories" && \ 13 | tz="Asia/Shanghai" && \ 14 | echo "$rs/main/" > $rf && \ 15 | echo "$rs/community/" >> $rf && \ 16 | apk update && \ 17 | apk upgrade && \ 18 | apk add curl acl tzdata && \ 19 | cp -rfv /usr/share/zoneinfo/$tz /etc/localtime && \ 20 | echo "$tz" > /etc/timezone && \ 21 | apk del tzdata -------------------------------------------------------------------------------- /alpine/3.9/README.md: -------------------------------------------------------------------------------- 1 | # alpine 2 | 3 | ## Build 4 | 5 | docker build statemood/alpine:3.9 . 6 | 7 | ## Push 8 | 9 | docker push statemood/alpine:3.9 10 | 11 | ## Pull 12 | 13 | docker pull statemood/alpine:3.9 14 | -------------------------------------------------------------------------------- /alpine/edge/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Lin Ru, 2018.01.06 3 | # Lin.Ru@msn.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM alpine:edge 10 | 11 | RUN rs="https://mirrors.aliyun.com/alpine/edge" && \ 12 | rf="/etc/apk/repositories" && \ 13 | tz="Asia/Shanghai" && \ 14 | echo -e "$rs/main/\n$rs/community/" > $rf && \ 15 | apk update && \ 16 | apk upgrade && \ 17 | apk add curl acl tzdata && \ 18 | cp -rfv /usr/share/zoneinfo/$tz /etc/localtime && \ 19 | echo "$tz" > /etc/timezone && \ 20 | apk del tzdata -------------------------------------------------------------------------------- /cassandra/v12/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM gcr.io/google-samples/cassandra:v12 -------------------------------------------------------------------------------- /centos/6/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM docker.io/centos:6 10 | 11 | LABEL MAINTAINER=Lin.Ru@msn.com 12 | 13 | RUN ln -sfv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ 14 | rpm -Uvh https://mirrors.tuna.tsinghua.edu.cn/epel/epel-release-latest-6.noarch.rpm && \ 15 | yum update -y && \ 16 | yum clean all && \ 17 | rm -rf /var/log/anaconda /anaconda-post.log /var/lib/yum 18 | -------------------------------------------------------------------------------- /centos/7/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM docker.io/centos:7 10 | 11 | LABEL MAINTAINER=Lin.Ru@msn.com 12 | 13 | RUN ln -sfv /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \ 14 | rpm -Uvh https://mirrors.tuna.tsinghua.edu.cn/epel/epel-release-latest-7.noarch.rpm && \ 15 | yum update -y && \ 16 | yum clean all && \ 17 | rm -rf /var/log/anaconda /anaconda-post.log /var/lib/yum -------------------------------------------------------------------------------- /cerebro/0.8.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:8u151 10 | 11 | COPY run.sh / 12 | 13 | RUN apk update && \ 14 | apk upgrade && \ 15 | apk add bash coreutils && \ 16 | v="0.8.1" && \ 17 | c="cerebro" && \ 18 | curl -L https://github.com/lmenezes/$c/releases/download/v$v/$c-$v.tgz | \ 19 | tar zxf - && \ 20 | mv $c-$v $c && \ 21 | chown -R root:root $c && \ 22 | chmod 755 /run.sh 23 | 24 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /cerebro/0.8.1/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | /cerebro/bin/cerebro 14 | else 15 | "$@" 16 | fi -------------------------------------------------------------------------------- /cerebro/0.8.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:8u191 10 | 11 | COPY run.sh / 12 | 13 | RUN apk update && \ 14 | apk upgrade && \ 15 | apk add bash coreutils && \ 16 | v="0.8.3" && \ 17 | c="cerebro" && \ 18 | curl -L https://github.com/lmenezes/$c/releases/download/v$v/$c-$v.tgz | \ 19 | tar zxf - && \ 20 | mv $c-$v $c && \ 21 | chown -R root:root $c && \ 22 | chmod 755 /run.sh 23 | 24 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /cerebro/0.8.3/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | /cerebro/bin/cerebro 14 | else 15 | "$@" 16 | fi -------------------------------------------------------------------------------- /elasticstack/elasticsearch/6.6.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:8u191 10 | 11 | COPY run.sh / 12 | 13 | ENV ES_VERSION="6.6.1" 14 | 15 | RUN apk update && \ 16 | apk upgrade && \ 17 | apk add bash coreutils sudo && \ 18 | v="$ES_VERSION" && \ 19 | e="elasticsearch" && \ 20 | adduser -D -g 1000 $e && \ 21 | curl -jk https://artifacts.elastic.co/downloads/$e/$e-$v.tar.gz | \ 22 | tar zxf - && \ 23 | mv $e-$v $e && \ 24 | rm -rfv $s/bin/*.bat $e/bin/*.exe && \ 25 | chown -R $e:$e /$e/config && \ 26 | chmod 755 /run.sh 27 | 28 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /elasticstack/elasticsearch/6.6.1/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | # Run USER 14 | name="elasticsearch" 15 | user="$name" 16 | home="/data/$name" 17 | cmd="/$name/bin/$name" 18 | net="-Enetwork.host=0.0.0.0" 19 | 20 | # path.logs 21 | log="-Epath.logs=/$name/logs" 22 | cfd="/$name/config" 23 | cfg="$cfd/$name.yml" 24 | data="-Epath.data=$home" 25 | jvmf="$cfd/jvm.options" 26 | 27 | test -z "$JAVA_OPTS" && JAVA_OPTS="-Xms1g -Xmx1g" 28 | test -z "$ES_NODE_NAME" && ES_NODE_NAME="$HOSTNAME" 29 | test -n "$ES_CLUSTER_NAME" && c_name="-Ecluster.name=$ES_CLUSTER_NAME" 30 | test -n "$ES_NODE_NAME" && n_name="-Enode.name=$ES_NODE_NAME" 31 | test -n "$ES_NODE_DATA" && es_data="-Enode.data=$ES_NODE_DATA" 32 | test -n "$ES_NODE_MASTER" && es_master="-Enode.master=$ES_NODE_MASTER" 33 | test -n "$ES_HTTP_ENABLED" && es_http="-Ehttp.enabled=$ES_HTTP_ENABLED" 34 | test -n "$ES_UNICAST_HOSTS" && ES_UNICAST="-Ediscovery.zen.ping.unicast.hosts=$ES_UNICAST_HOSTS" 35 | 36 | ES_OPTS="$c_name $n_name $es_data $es_master $es_http $ES_UNICAST $ES_EXTRA_OPTS" 37 | 38 | # Set jvm options to file jvm.options 39 | sed -i '/-Xm[sx].g/d' $jvmf 40 | 41 | for x in $JAVA_OPTS 42 | do 43 | echo "Set $x" 44 | echo $x >> $jvmf 45 | done 46 | 47 | test -d $home || mkdir -p $home 48 | chown -R $user:$user $home /$name/logs 49 | 50 | echo "Start $name with options: $ES_OPTS, ES_JAVA_OPTS=$ES_JAVA_OPTS, JAVA_OPTS=$JAVA_OPTS" 51 | 52 | sudo -u $user $cmd $log $data $net $ES_OPTS 53 | else 54 | "$@" 55 | fi -------------------------------------------------------------------------------- /etcd/3.2.18/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | COPY run.sh / 12 | 13 | ENV ETCD_VERSION="v3.2.18" 14 | RUN apk update && \ 15 | apk upgrade && \ 16 | curl -Ljk https://github.com/coreos/etcd/releases/download/$ETCD_VERSION/etcd-$ETCD_VERSION-linux-amd64.tar.gz | tar zxf - && \ 17 | mv etcd-$ETCD_VERSION-linux-amd64/etcd* /usr/local/bin && \ 18 | rm -rf etcd-$ETCD_VERSION-linux-amd64 && \ 19 | chmod 755 /run.sh 20 | 21 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /etcd/3.2.18/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | test -z "$ETCD_NAME" && ETCD_NAME="default" 14 | 15 | ip="`hostname -i`" 16 | ld_2379="http://$ip:2379" 17 | ld_2380="http://$ip:2380" 18 | 19 | test -z "$ETCD_HOME" && ETCD_HOME="/var/lib/etcd" 20 | test -z "$ETCD_DATA" && ETCD_DATA="$ETCD_HOME/data" 21 | 22 | test -d "$ETCD_DATA" && ETCD_STATE="existing" || ETCD_STATE="new" 23 | 24 | echo "Start etcd server named: $ETCD_NAME, listening $ip" 25 | 26 | etcd --name $ETCD_NAME \ 27 | --data-dir $ETCD_DATA \ 28 | --wal-dir $ETCD_HOME/wal \ 29 | --listen-peer-urls $ld_2380 \ 30 | --listen-client-urls $ld_2379 \ 31 | --initial-advertise-peer-urls $ld_2380 \ 32 | --initial-cluster "$ETCD_NAME=$ld_2380" \ 33 | --initial-cluster-state "$ETCD_STATE" \ 34 | --initial-cluster-token 'etcd-cluster' \ 35 | --advertise-client-urls $ld_2379 36 | else 37 | "$@" 38 | fi -------------------------------------------------------------------------------- /go/1.10/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | RUN apk update && \ 12 | apk upgrade && \ 13 | apk add "go1.10" -------------------------------------------------------------------------------- /grafana/4.6.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/centos:7 10 | 11 | ENV VERSION 4.6.3 12 | 13 | COPY run.sh / 14 | 15 | RUN yum update -y && \ 16 | yum install -y fontconfig freetype urw-fonts && \ 17 | yum clean all && \ 18 | curl -Lskj https://dl.rulin.me/grafana/grafana-$VERSION.linux-x64.tar.gz | \ 19 | tar zxf - && \ 20 | mv grafana-$VERSION /grafana && \ 21 | chmod 755 /run.sh 22 | 23 | ADD conf /grafana/conf 24 | 25 | ENTRYPOINT ["/run.sh"] 26 | -------------------------------------------------------------------------------- /grafana/4.6.3/conf/custom.ini: -------------------------------------------------------------------------------- 1 | ##################### Grafana Configuration Example ##################### 2 | # 3 | # Everything has defaults so you only need to uncomment things you want to 4 | # change 5 | 6 | # possible values : production, development 7 | ; app_mode = production 8 | 9 | # instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty 10 | ; instance_name = ${HOSTNAME} 11 | 12 | #################################### Paths #################################### 13 | [paths] 14 | # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) 15 | # 16 | data = /data/grafana 17 | # 18 | # Directory where grafana can store logs 19 | # 20 | logs = /tmp/grafana 21 | # 22 | # Directory where grafana will automatically scan and look for plugins 23 | # 24 | plugins = /data/grafana/plugins 25 | 26 | # 27 | #################################### Server #################################### 28 | [server] 29 | # Protocol (http or https) 30 | ;protocol = http 31 | 32 | # The ip address to bind to, empty will bind to all interfaces 33 | http_addr = 34 | 35 | # The http port to use 36 | http_port = 3000 37 | 38 | # The public facing domain name used to access grafana from a browser 39 | ;domain = localhost 40 | 41 | # Redirect to correct domain if host header does not match domain 42 | # Prevents DNS rebinding attacks 43 | ;enforce_domain = false 44 | 45 | # The full public facing url you use in browser, used for redirects and emails 46 | # If you use reverse proxy and sub path specify full url (with sub path) 47 | ;root_url = http://localhost:3000 48 | 49 | # Log web requests 50 | ;router_logging = false 51 | 52 | # the path relative working path 53 | ;static_root_path = public 54 | 55 | # enable gzip 56 | ;enable_gzip = false 57 | 58 | # https certs & key file 59 | ;cert_file = 60 | ;cert_key = 61 | 62 | #################################### Database #################################### 63 | [database] 64 | # You can configure the database connection by specifying type, host, name, user and password 65 | # as seperate properties or as on string using the url propertie. 66 | 67 | # Either "mysql", "postgres" or "sqlite3", it's your choice 68 | ;type = sqlite3 69 | ;host = 127.0.0.1:3306 70 | ;name = grafana 71 | ;user = root 72 | # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" 73 | ;password = 74 | 75 | # Use either URL or the previous fields to configure the database 76 | # Example: mysql://user:secret@host:port/database 77 | ;url = 78 | 79 | # For "postgres" only, either "disable", "require" or "verify-full" 80 | ;ssl_mode = disable 81 | 82 | # For "sqlite3" only, path relative to data_path setting 83 | ;path = grafana.db 84 | 85 | #################################### Session #################################### 86 | [session] 87 | # Either "memory", "file", "redis", "mysql", "postgres", default is "file" 88 | ;provider = file 89 | 90 | # Provider config options 91 | # memory: not have any config yet 92 | # file: session dir path, is relative to grafana data_path 93 | # redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana` 94 | # mysql: go-sql-driver/mysql dsn config string, e.g. `user:password@tcp(127.0.0.1:3306)/database_name` 95 | # postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable 96 | ;provider_config = sessions 97 | 98 | # Session cookie name 99 | ;cookie_name = grafana_sess 100 | 101 | # If you use session in https only, default is false 102 | ;cookie_secure = false 103 | 104 | # Session life time, default is 86400 105 | ;session_life_time = 86400 106 | 107 | #################################### Analytics #################################### 108 | [analytics] 109 | # Server reporting, sends usage counters to stats.grafana.org every 24 hours. 110 | # No ip addresses are being tracked, only simple counters to track 111 | # running instances, dashboard and error counts. It is very helpful to us. 112 | # Change this option to false to disable reporting. 113 | ;reporting_enabled = true 114 | 115 | # Set to false to disable all checks to https://grafana.net 116 | # for new vesions (grafana itself and plugins), check is used 117 | # in some UI views to notify that grafana or plugin update exists 118 | # This option does not cause any auto updates, nor send any information 119 | # only a GET request to http://grafana.net to get latest versions 120 | ;check_for_updates = true 121 | 122 | # Google Analytics universal tracking code, only enabled if you specify an id here 123 | ;google_analytics_ua_id = 124 | 125 | #################################### Security #################################### 126 | [security] 127 | # default admin user, created on startup 128 | ;admin_user = admin 129 | 130 | # default admin password, can be changed before first start of grafana, or in profile settings 131 | ;admin_password = admin 132 | 133 | # used for signing 134 | ;secret_key = SW2YcwTIb9zpOOhoPsMm 135 | 136 | # Auto-login remember days 137 | ;login_remember_days = 7 138 | ;cookie_username = grafana_user 139 | ;cookie_remember_name = grafana_remember 140 | 141 | # disable gravatar profile images 142 | ;disable_gravatar = false 143 | 144 | # data source proxy whitelist (ip_or_domain:port separated by spaces) 145 | ;data_source_proxy_whitelist = 146 | 147 | [snapshots] 148 | # snapshot sharing options 149 | ;external_enabled = true 150 | ;external_snapshot_url = https://snapshots-origin.raintank.io 151 | ;external_snapshot_name = Publish to snapshot.raintank.io 152 | 153 | # remove expired snapshot 154 | ;snapshot_remove_expired = true 155 | 156 | # remove snapshots after 90 days 157 | ;snapshot_TTL_days = 90 158 | 159 | #################################### Users #################################### 160 | [users] 161 | # disable user signup / registration 162 | ;allow_sign_up = true 163 | 164 | # Allow non admin users to create organizations 165 | ;allow_org_create = true 166 | 167 | # Set to true to automatically assign new users to the default organization (id 1) 168 | ;auto_assign_org = true 169 | 170 | # Default role new users will be automatically assigned (if disabled above is set to true) 171 | ;auto_assign_org_role = Viewer 172 | 173 | # Background text for the user field on the login page 174 | ;login_hint = email or username 175 | 176 | # Default UI theme ("dark" or "light") 177 | ;default_theme = dark 178 | 179 | [auth] 180 | # Set to true to disable (hide) the login form, useful if you use OAuth, defaults to false 181 | ;disable_login_form = false 182 | 183 | #################################### Anonymous Auth ########################## 184 | [auth.anonymous] 185 | # enable anonymous access 186 | ;enabled = false 187 | 188 | # specify organization name that should be used for unauthenticated users 189 | ;org_name = Main Org. 190 | 191 | # specify role for unauthenticated users 192 | ;org_role = Viewer 193 | 194 | #################################### Github Auth ########################## 195 | [auth.github] 196 | ;enabled = false 197 | ;allow_sign_up = true 198 | ;client_id = some_id 199 | ;client_secret = some_secret 200 | ;scopes = user:email,read:org 201 | ;auth_url = https://github.com/login/oauth/authorize 202 | ;token_url = https://github.com/login/oauth/access_token 203 | ;api_url = https://api.github.com/user 204 | ;team_ids = 205 | ;allowed_organizations = 206 | 207 | #################################### Google Auth ########################## 208 | [auth.google] 209 | ;enabled = false 210 | ;allow_sign_up = true 211 | ;client_id = some_client_id 212 | ;client_secret = some_client_secret 213 | ;scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email 214 | ;auth_url = https://accounts.google.com/o/oauth2/auth 215 | ;token_url = https://accounts.google.com/o/oauth2/token 216 | ;api_url = https://www.googleapis.com/oauth2/v1/userinfo 217 | ;allowed_domains = 218 | 219 | #################################### Generic OAuth ########################## 220 | [auth.generic_oauth] 221 | ;enabled = false 222 | ;name = OAuth 223 | ;allow_sign_up = true 224 | ;client_id = some_id 225 | ;client_secret = some_secret 226 | ;scopes = user:email,read:org 227 | ;auth_url = https://foo.bar/login/oauth/authorize 228 | ;token_url = https://foo.bar/login/oauth/access_token 229 | ;api_url = https://foo.bar/user 230 | ;team_ids = 231 | ;allowed_organizations = 232 | 233 | #################################### Grafana.net Auth #################### 234 | [auth.grafananet] 235 | ;enabled = false 236 | ;allow_sign_up = true 237 | ;client_id = some_id 238 | ;client_secret = some_secret 239 | ;scopes = user:email 240 | ;allowed_organizations = 241 | 242 | #################################### Auth Proxy ########################## 243 | [auth.proxy] 244 | ;enabled = false 245 | ;header_name = X-WEBAUTH-USER 246 | ;header_property = username 247 | ;auto_sign_up = true 248 | ;ldap_sync_ttl = 60 249 | ;whitelist = 192.168.1.1, 192.168.2.1 250 | 251 | #################################### Basic Auth ########################## 252 | [auth.basic] 253 | ;enabled = true 254 | 255 | #################################### Auth LDAP ########################## 256 | [auth.ldap] 257 | ;enabled = false 258 | ;config_file = /etc/grafana/ldap.toml 259 | ;allow_sign_up = true 260 | 261 | #################################### SMTP / Emailing ########################## 262 | [smtp] 263 | ;enabled = false 264 | ;host = localhost:25 265 | ;user = 266 | ;password = 267 | ;cert_file = 268 | ;key_file = 269 | ;skip_verify = false 270 | ;from_address = admin@grafana.localhost 271 | 272 | [emails] 273 | ;welcome_email_on_sign_up = false 274 | 275 | #################################### Logging ########################## 276 | [log] 277 | # Either "console", "file", "syslog". Default is console and file 278 | # Use space to separate multiple modes, e.g. "console file" 279 | ;mode = console file 280 | 281 | # Either "trace", "debug", "info", "warn", "error", "critical", default is "info" 282 | ;level = info 283 | 284 | # optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug 285 | ;filters = 286 | 287 | 288 | # For "console" mode only 289 | [log.console] 290 | ;level = 291 | 292 | # log line format, valid options are text, console and json 293 | ;format = console 294 | 295 | # For "file" mode only 296 | [log.file] 297 | ;level = 298 | 299 | # log line format, valid options are text, console and json 300 | ;format = text 301 | 302 | # This enables automated log rotate(switch of following options), default is true 303 | ;log_rotate = true 304 | 305 | # Max line number of single file, default is 1000000 306 | ;max_lines = 1000000 307 | 308 | # Max size shift of single file, default is 28 means 1 << 28, 256MB 309 | ;max_size_shift = 28 310 | 311 | # Segment log daily, default is true 312 | ;daily_rotate = true 313 | 314 | # Expired days of log file(delete after max days), default is 7 315 | ;max_days = 7 316 | 317 | [log.syslog] 318 | ;level = 319 | 320 | # log line format, valid options are text, console and json 321 | ;format = text 322 | 323 | # Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used. 324 | ;network = 325 | ;address = 326 | 327 | # Syslog facility. user, daemon and local0 through local7 are valid. 328 | ;facility = 329 | 330 | # Syslog tag. By default, the process' argv[0] is used. 331 | ;tag = 332 | 333 | 334 | #################################### AMQP Event Publisher ########################## 335 | [event_publisher] 336 | ;enabled = false 337 | ;rabbitmq_url = amqp://localhost/ 338 | ;exchange = grafana_events 339 | 340 | ;#################################### Dashboard JSON files ########################## 341 | [dashboards.json] 342 | ;enabled = false 343 | ;path = /var/lib/grafana/dashboards 344 | 345 | #################################### Alerting ###################################### 346 | [alerting] 347 | # Makes it possible to turn off alert rule execution. 348 | ;execute_alerts = true 349 | 350 | #################################### Internal Grafana Metrics ########################## 351 | # Metrics available at HTTP API Url /api/metrics 352 | [metrics] 353 | # Disable / Enable internal metrics 354 | ;enabled = true 355 | 356 | # Publish interval 357 | ;interval_seconds = 10 358 | 359 | # Send internal metrics to Graphite 360 | [metrics.graphite] 361 | # Enable by setting the address setting (ex localhost:2003) 362 | ;address = 363 | ;prefix = prod.grafana.%(instance_name)s. 364 | 365 | #################################### Internal Grafana Metrics ########################## 366 | # Url used to to import dashboards directly from Grafana.net 367 | [grafana_net] 368 | ;url = https://grafana.net 369 | 370 | #################################### External image storage ########################## 371 | [external_image_storage] 372 | # Used for uploading images to public servers so they can be included in slack/email messages. 373 | # you can choose between (s3, webdav) 374 | ;provider = 375 | 376 | [external_image_storage.s3] 377 | ;bucket_url = 378 | ;access_key = 379 | ;secret_key = 380 | 381 | [external_image_storage.webdav] 382 | ;url = 383 | ;username = 384 | ;password = 385 | -------------------------------------------------------------------------------- /grafana/4.6.3/conf/defaults.ini: -------------------------------------------------------------------------------- 1 | ##################### Grafana Configuration Defaults ##################### 2 | # 3 | # Do not modify this file in grafana installs 4 | # 5 | 6 | # possible values : production, development 7 | app_mode = production 8 | 9 | # instance name, defaults to HOSTNAME environment variable value or hostname if HOSTNAME var is empty 10 | instance_name = ${HOSTNAME} 11 | 12 | #################################### Paths ############################### 13 | [paths] 14 | # Path to where grafana can store temp files, sessions, and the sqlite3 db (if that is used) 15 | # 16 | data = /data 17 | # 18 | # Directory where grafana can store logs 19 | # 20 | logs = /tmp/log 21 | # 22 | # Directory where grafana will automatically scan and look for plugins 23 | # 24 | plugins = /data/plugins 25 | 26 | #################################### Server ############################## 27 | [server] 28 | # Protocol (http or https) 29 | protocol = http 30 | 31 | # The ip address to bind to, empty will bind to all interfaces 32 | http_addr = 33 | 34 | # The http port to use 35 | http_port = 3000 36 | 37 | # The public facing domain name used to access grafana from a browser 38 | domain = localhost 39 | 40 | # Redirect to correct domain if host header does not match domain 41 | # Prevents DNS rebinding attacks 42 | enforce_domain = false 43 | 44 | # The full public facing url 45 | root_url = %(protocol)s://%(domain)s:%(http_port)s/ 46 | 47 | # Log web requests 48 | router_logging = false 49 | 50 | # the path relative working path 51 | static_root_path = public 52 | 53 | # enable gzip 54 | enable_gzip = false 55 | 56 | # https certs & key file 57 | cert_file = 58 | cert_key = 59 | 60 | #################################### Database ############################ 61 | [database] 62 | # You can configure the database connection by specifying type, host, name, user and password 63 | # as seperate properties or as on string using the url propertie. 64 | 65 | # Either "mysql", "postgres" or "sqlite3", it's your choice 66 | type = sqlite3 67 | host = 127.0.0.1:3306 68 | name = grafana 69 | user = root 70 | # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" 71 | password = 72 | # Use either URL or the previous fields to configure the database 73 | # Example: mysql://user:secret@host:port/database 74 | url = 75 | 76 | # For "postgres", use either "disable", "require" or "verify-full" 77 | # For "mysql", use either "true", "false", or "skip-verify". 78 | ssl_mode = disable 79 | 80 | ca_cert_path = 81 | client_key_path = 82 | client_cert_path = 83 | server_cert_name = 84 | 85 | # For "sqlite3" only, path relative to data_path setting 86 | path = grafana.db 87 | 88 | #################################### Session ############################# 89 | [session] 90 | # Either "memory", "file", "redis", "mysql", "postgres", "memcache", default is "file" 91 | provider = file 92 | 93 | # Provider config options 94 | # memory: not have any config yet 95 | # file: session dir path, is relative to grafana data_path 96 | # redis: config like redis server e.g. `addr=127.0.0.1:6379,pool_size=100,db=grafana` 97 | # postgres: user=a password=b host=localhost port=5432 dbname=c sslmode=disable 98 | # mysql: go-sql-driver/mysql dsn config string, examples: 99 | # `user:password@tcp(127.0.0.1:3306)/database_name` 100 | # `user:password@unix(/var/run/mysqld/mysqld.sock)/database_name` 101 | # memcache: 127.0.0.1:11211 102 | 103 | 104 | provider_config = sessions 105 | 106 | # Session cookie name 107 | cookie_name = grafana_sess 108 | 109 | # If you use session in https only, default is false 110 | cookie_secure = false 111 | 112 | # Session life time, default is 86400 113 | session_life_time = 86400 114 | gc_interval_time = 86400 115 | 116 | #################################### Analytics ########################### 117 | [analytics] 118 | # Server reporting, sends usage counters to stats.grafana.org every 24 hours. 119 | # No ip addresses are being tracked, only simple counters to track 120 | # running instances, dashboard and error counts. It is very helpful to us. 121 | # Change this option to false to disable reporting. 122 | reporting_enabled = true 123 | 124 | # Set to false to disable all checks to https://grafana.net 125 | # for new vesions (grafana itself and plugins), check is used 126 | # in some UI views to notify that grafana or plugin update exists 127 | # This option does not cause any auto updates, nor send any information 128 | # only a GET request to http://grafana.net to get latest versions 129 | check_for_updates = true 130 | 131 | # Google Analytics universal tracking code, only enabled if you specify an id here 132 | google_analytics_ua_id = 133 | 134 | # Google Tag Manager ID, only enabled if you specify an id here 135 | google_tag_manager_id = 136 | 137 | #################################### Security ############################ 138 | [security] 139 | # default admin user, created on startup 140 | admin_user = admin 141 | 142 | # default admin password, can be changed before first start of grafana, or in profile settings 143 | admin_password = admin 144 | 145 | # used for signing 146 | secret_key = SW2YcwTIb9zpOOhoPsMm 147 | 148 | # Auto-login remember days 149 | login_remember_days = 7 150 | cookie_username = grafana_user 151 | cookie_remember_name = grafana_remember 152 | 153 | # disable gravatar profile images 154 | disable_gravatar = false 155 | 156 | # data source proxy whitelist (ip_or_domain:port separated by spaces) 157 | data_source_proxy_whitelist = 158 | 159 | [snapshots] 160 | # snapshot sharing options 161 | external_enabled = true 162 | external_snapshot_url = https://snapshots-origin.raintank.io 163 | external_snapshot_name = Publish to snapshot.raintank.io 164 | 165 | # remove expired snapshot 166 | snapshot_remove_expired = true 167 | 168 | # remove snapshots after 90 days 169 | snapshot_TTL_days = 90 170 | 171 | #################################### Users #################################### 172 | [users] 173 | # disable user signup / registration 174 | allow_sign_up = true 175 | 176 | # Allow non admin users to create organizations 177 | allow_org_create = true 178 | 179 | # Set to true to automatically assign new users to the default organization (id 1) 180 | auto_assign_org = true 181 | 182 | # Default role new users will be automatically assigned (if auto_assign_org above is set to true) 183 | auto_assign_org_role = Viewer 184 | 185 | # Require email validation before sign up completes 186 | verify_email_enabled = false 187 | 188 | # Background text for the user field on the login page 189 | login_hint = email or username 190 | 191 | # Default UI theme ("dark" or "light") 192 | default_theme = dark 193 | 194 | [auth] 195 | # Set to true to disable (hide) the login form, useful if you use OAuth 196 | disable_login_form = false 197 | 198 | #################################### Anonymous Auth ###################### 199 | [auth.anonymous] 200 | # enable anonymous access 201 | enabled = false 202 | 203 | # specify organization name that should be used for unauthenticated users 204 | org_name = Main Org. 205 | 206 | # specify role for unauthenticated users 207 | org_role = Viewer 208 | 209 | #################################### Github Auth ######################### 210 | [auth.github] 211 | enabled = false 212 | allow_sign_up = true 213 | client_id = some_id 214 | client_secret = some_secret 215 | scopes = user:email 216 | auth_url = https://github.com/login/oauth/authorize 217 | token_url = https://github.com/login/oauth/access_token 218 | api_url = https://api.github.com/user 219 | team_ids = 220 | allowed_organizations = 221 | 222 | #################################### Google Auth ######################### 223 | [auth.google] 224 | enabled = false 225 | allow_sign_up = true 226 | client_id = some_client_id 227 | client_secret = some_client_secret 228 | scopes = https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email 229 | auth_url = https://accounts.google.com/o/oauth2/auth 230 | token_url = https://accounts.google.com/o/oauth2/token 231 | api_url = https://www.googleapis.com/oauth2/v1/userinfo 232 | allowed_domains = 233 | hosted_domain = 234 | 235 | #################################### Grafana.net Auth #################### 236 | [auth.grafananet] 237 | enabled = false 238 | allow_sign_up = true 239 | client_id = some_id 240 | client_secret = some_secret 241 | scopes = user:email 242 | allowed_organizations = 243 | 244 | #################################### Generic OAuth ####################### 245 | [auth.generic_oauth] 246 | name = OAuth 247 | enabled = false 248 | allow_sign_up = true 249 | client_id = some_id 250 | client_secret = some_secret 251 | scopes = user:email 252 | auth_url = 253 | token_url = 254 | api_url = 255 | team_ids = 256 | allowed_organizations = 257 | 258 | #################################### Basic Auth ########################## 259 | [auth.basic] 260 | enabled = true 261 | 262 | #################################### Auth Proxy ########################## 263 | [auth.proxy] 264 | enabled = false 265 | header_name = X-WEBAUTH-USER 266 | header_property = username 267 | auto_sign_up = true 268 | ldap_sync_ttl = 60 269 | whitelist = 270 | 271 | #################################### Auth LDAP ########################### 272 | [auth.ldap] 273 | enabled = false 274 | config_file = /etc/grafana/ldap.toml 275 | allow_sign_up = true 276 | 277 | #################################### SMTP / Emailing ##################### 278 | [smtp] 279 | enabled = false 280 | host = localhost:25 281 | user = 282 | password = 283 | cert_file = 284 | key_file = 285 | skip_verify = false 286 | from_address = admin@grafana.localhost 287 | 288 | [emails] 289 | welcome_email_on_sign_up = false 290 | templates_pattern = emails/*.html 291 | 292 | #################################### Logging ########################## 293 | [log] 294 | # Either "console", "file", "syslog". Default is console and file 295 | # Use space to separate multiple modes, e.g. "console file" 296 | mode = console file 297 | 298 | # Either "debug", "info", "warn", "error", "critical", default is "info" 299 | level = info 300 | 301 | # optional settings to set different levels for specific loggers. Ex filters = sqlstore:debug 302 | filters = 303 | 304 | # For "console" mode only 305 | [log.console] 306 | level = 307 | 308 | # log line format, valid options are text, console and json 309 | format = console 310 | 311 | # For "file" mode only 312 | [log.file] 313 | level = 314 | 315 | # log line format, valid options are text, console and json 316 | format = text 317 | 318 | # This enables automated log rotate(switch of following options), default is true 319 | log_rotate = true 320 | 321 | # Max line number of single file, default is 1000000 322 | max_lines = 1000000 323 | 324 | # Max size shift of single file, default is 28 means 1 << 28, 256MB 325 | max_size_shift = 28 326 | 327 | # Segment log daily, default is true 328 | daily_rotate = true 329 | 330 | # Expired days of log file(delete after max days), default is 7 331 | max_days = 7 332 | 333 | [log.syslog] 334 | level = 335 | 336 | # log line format, valid options are text, console and json 337 | format = text 338 | 339 | # Syslog network type and address. This can be udp, tcp, or unix. If left blank, the default unix endpoints will be used. 340 | network = 341 | address = 342 | 343 | # Syslog facility. user, daemon and local0 through local7 are valid. 344 | facility = 345 | 346 | # Syslog tag. By default, the process' argv[0] is used. 347 | tag = 348 | 349 | 350 | #################################### AMQP Event Publisher ################ 351 | [event_publisher] 352 | enabled = false 353 | rabbitmq_url = amqp://localhost/ 354 | exchange = grafana_events 355 | 356 | #################################### Dashboard JSON files ################ 357 | [dashboards.json] 358 | enabled = false 359 | path = /var/lib/grafana/dashboards 360 | 361 | #################################### Usage Quotas ######################## 362 | [quota] 363 | enabled = false 364 | 365 | #### set quotas to -1 to make unlimited. #### 366 | # limit number of users per Org. 367 | org_user = 10 368 | 369 | # limit number of dashboards per Org. 370 | org_dashboard = 100 371 | 372 | # limit number of data_sources per Org. 373 | org_data_source = 10 374 | 375 | # limit number of api_keys per Org. 376 | org_api_key = 10 377 | 378 | # limit number of orgs a user can create. 379 | user_org = 10 380 | 381 | # Global limit of users. 382 | global_user = -1 383 | 384 | # global limit of orgs. 385 | global_org = -1 386 | 387 | # global limit of dashboards 388 | global_dashboard = -1 389 | 390 | # global limit of api_keys 391 | global_api_key = -1 392 | 393 | # global limit on number of logged in users. 394 | global_session = -1 395 | 396 | #################################### Alerting ############################ 397 | [alerting] 398 | # Makes it possible to turn off alert rule execution. 399 | execute_alerts = true 400 | 401 | #################################### Internal Grafana Metrics ############ 402 | # Metrics available at HTTP API Url /api/metrics 403 | [metrics] 404 | enabled = true 405 | interval_seconds = 10 406 | 407 | # Send internal Grafana metrics to graphite 408 | [metrics.graphite] 409 | # Enable by setting the address setting (ex localhost:2003) 410 | address = 411 | prefix = prod.grafana.%(instance_name)s. 412 | 413 | [grafana_net] 414 | url = https://grafana.net 415 | 416 | #################################### External Image Storage ############## 417 | [external_image_storage] 418 | # You can choose between (s3, webdav) 419 | provider = 420 | 421 | [external_image_storage.s3] 422 | bucket_url = 423 | access_key = 424 | secret_key = 425 | 426 | [external_image_storage.webdav] 427 | url = 428 | username = 429 | password = 430 | -------------------------------------------------------------------------------- /grafana/4.6.3/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | d="/data/grafana" 14 | 15 | test -d "$d" && ln -sv $d /var/lib/grafana 16 | 17 | cd /grafana 18 | ./bin/grafana-server 19 | else 20 | "$@" 21 | fi 22 | -------------------------------------------------------------------------------- /grafana/5.2.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM centos:7 10 | 11 | COPY run.sh / 12 | 13 | RUN yum update -y && \ 14 | yum install -y fontconfig freetype urw-fonts && \ 15 | yum clean all && \ 16 | v="5.2.0" && \ 17 | g="grafana" && \ 18 | curl -L https://s3-us-west-2.amazonaws.com/$g-releases/release/$g-$v.linux-amd64.tar.gz | \ 19 | tar zxf - && \ 20 | mv $g-$v /$g && \ 21 | chmod 755 /run.sh 22 | 23 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /grafana/5.2.0/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | d="/grafana/data" 14 | 15 | p="$d/plugins" 16 | t="/var/lib/grafana" 17 | 18 | test -d $p || mkdir $p 19 | test -d $t || mkdir $t 20 | 21 | ln -s $p $t/plugins 22 | 23 | cd /grafana 24 | ./bin/grafana-server 25 | else 26 | "$@" 27 | fi -------------------------------------------------------------------------------- /grafana/5.2.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM centos:7 10 | 11 | COPY run.sh / 12 | 13 | RUN yum update -y && \ 14 | yum install -y fontconfig freetype urw-fonts && \ 15 | yum clean all && \ 16 | v="5.2.0" && \ 17 | g="grafana" && \ 18 | curl -L https://s3-us-west-2.amazonaws.com/$g-releases/release/$g-$v.linux-amd64.tar.gz | \ 19 | tar zxf - && \ 20 | mv $g-$v /$g && \ 21 | chmod 755 /run.sh 22 | 23 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /grafana/5.2.2/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | d="/grafana/data" 14 | 15 | p="$d/plugins" 16 | t="/var/lib/grafana" 17 | 18 | test -d $p || mkdir $p 19 | test -d $t || mkdir $t 20 | 21 | ln -s $p $t/plugins 22 | 23 | cd /grafana 24 | ./bin/grafana-server 25 | else 26 | "$@" 27 | fi -------------------------------------------------------------------------------- /grafana/5.4.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM img.linge.io/library/centos:7 10 | 11 | COPY run.sh / 12 | 13 | RUN yum update -y && \ 14 | yum install -y fontconfig freetype urw-fonts && \ 15 | yum clean all && \ 16 | v="5.4.0" && \ 17 | g="grafana" && \ 18 | curl -L https://s3-us-west-2.amazonaws.com/$g-releases/release/$g-$v.linux-amd64.tar.gz | \ 19 | tar zxf - && \ 20 | mv $g-$v /$g && \ 21 | chmod 755 /run.sh 22 | 23 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /grafana/5.4.2/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | d="/grafana/data" 14 | 15 | p="$d/plugins" 16 | t="/var/lib/grafana" 17 | 18 | test -d $p || mkdir $p 19 | test -d $t || mkdir $t 20 | 21 | ln -s $p $t/plugins 22 | 23 | cd /grafana 24 | ./bin/grafana-server 25 | else 26 | "$@" 27 | fi -------------------------------------------------------------------------------- /jdk/8u151/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | RUN apk update && \ 12 | apk add "openjdk8~=8.151" 13 | -------------------------------------------------------------------------------- /jdk/8u181/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | RUN apk update && \ 12 | apk upgrade && \ 13 | apk add "openjdk8~=8.181" -------------------------------------------------------------------------------- /jdk/8u212/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.9 10 | 11 | RUN apk update && \ 12 | apk add "openjdk8~=8.212" 13 | -------------------------------------------------------------------------------- /jre/1105/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2020.01.06 3 | # Lin.Ru@msn.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.11 10 | 11 | RUN apk update && \ 12 | apk upgrade && \ 13 | apk add "openjdk11-jre~=11.0.5" -------------------------------------------------------------------------------- /jre/8u151/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | RUN apk update && \ 12 | apk add "openjdk8-jre~=8.151" -------------------------------------------------------------------------------- /jre/8u181/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | RUN apk update && \ 12 | apk upgrade && \ 13 | apk add "openjdk8-jre~=8.181" -------------------------------------------------------------------------------- /jre/8u232/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.11 10 | 11 | RUN apk update && \ 12 | apk upgrade && \ 13 | apk add "openjdk8-jre~=8.232" -------------------------------------------------------------------------------- /kafka/2.1.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/jre:8u181 2 | 3 | RUN apk update && \ 4 | apk add bash && \ 5 | kn=kafka && \ 6 | ku=$kn && \ 7 | kv=2.1.0 && \ 8 | kd=/var/lib/$kn/data && \ 9 | kh=/opt/$kn && \ 10 | kp=${kn}_2.12-$kv && \ 11 | curl -LO https://mirrors.tuna.tsinghua.edu.cn/apache/$kn/$kv/$kp.tgz && \ 12 | mkdir -p /opt && \ 13 | tar zxf $kp.tgz -C /opt && \ 14 | mv /opt/$kp $kh && \ 15 | mkdir -p $kh/logs && \ 16 | rm -fr $kp.tgz $kh/bin/windows && \ 17 | ln -s $kh/bin/* /usr/local/bin/ 18 | 19 | COPY log4j.properties /opt/kafka/config/ 20 | 21 | RUN adduser -D -u 205 kafka && \ 22 | kd=/var/lib/kafka && \ 23 | mkdir -p $kd && \ 24 | chown -R kafka:kafka $kd /opt/kafka/logs -------------------------------------------------------------------------------- /kafka/2.1.0/log4j.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # Unspecified loggers and loggers with additivity=true output to server.log and stdout 17 | # Note that INFO only applies to unspecified loggers, the log level of the child logger is used otherwise 18 | log4j.rootLogger=INFO, stdout, kafkaAppender 19 | 20 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender 21 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout 22 | log4j.appender.stdout.layout.ConversionPattern=[%d] %p %m (%c)%n 23 | 24 | log4j.appender.kafkaAppender=org.apache.log4j.DailyRollingFileAppender 25 | log4j.appender.kafkaAppender.DatePattern='.'yyyy-MM-dd-HH 26 | log4j.appender.kafkaAppender.File=${kafka.logs.dir}/server.log 27 | log4j.appender.kafkaAppender.layout=org.apache.log4j.PatternLayout 28 | log4j.appender.kafkaAppender.layout.ConversionPattern=[%d] %p %m (%c)%n 29 | 30 | log4j.appender.stateChangeAppender=org.apache.log4j.DailyRollingFileAppender 31 | log4j.appender.stateChangeAppender.DatePattern='.'yyyy-MM-dd-HH 32 | log4j.appender.stateChangeAppender.File=${kafka.logs.dir}/state-change.log 33 | log4j.appender.stateChangeAppender.layout=org.apache.log4j.PatternLayout 34 | log4j.appender.stateChangeAppender.layout.ConversionPattern=[%d] %p %m (%c)%n 35 | 36 | log4j.appender.requestAppender=org.apache.log4j.DailyRollingFileAppender 37 | log4j.appender.requestAppender.DatePattern='.'yyyy-MM-dd-HH 38 | log4j.appender.requestAppender.File=${kafka.logs.dir}/kafka-request.log 39 | log4j.appender.requestAppender.layout=org.apache.log4j.PatternLayout 40 | log4j.appender.requestAppender.layout.ConversionPattern=[%d] %p %m (%c)%n 41 | 42 | log4j.appender.cleanerAppender=org.apache.log4j.DailyRollingFileAppender 43 | log4j.appender.cleanerAppender.DatePattern='.'yyyy-MM-dd-HH 44 | log4j.appender.cleanerAppender.File=${kafka.logs.dir}/log-cleaner.log 45 | log4j.appender.cleanerAppender.layout=org.apache.log4j.PatternLayout 46 | log4j.appender.cleanerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n 47 | 48 | log4j.appender.controllerAppender=org.apache.log4j.DailyRollingFileAppender 49 | log4j.appender.controllerAppender.DatePattern='.'yyyy-MM-dd-HH 50 | log4j.appender.controllerAppender.File=${kafka.logs.dir}/controller.log 51 | log4j.appender.controllerAppender.layout=org.apache.log4j.PatternLayout 52 | log4j.appender.controllerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n 53 | 54 | log4j.appender.authorizerAppender=org.apache.log4j.DailyRollingFileAppender 55 | log4j.appender.authorizerAppender.DatePattern='.'yyyy-MM-dd-HH 56 | log4j.appender.authorizerAppender.File=${kafka.logs.dir}/kafka-authorizer.log 57 | log4j.appender.authorizerAppender.layout=org.apache.log4j.PatternLayout 58 | log4j.appender.authorizerAppender.layout.ConversionPattern=[%d] %p %m (%c)%n 59 | 60 | # Change the two lines below to adjust ZK client logging 61 | #log4j.logger.org.I0Itec.zkclient.ZkClient=INFO 62 | #log4j.logger.org.apache.zookeeper=INFO 63 | 64 | # Change the two lines below to adjust the general broker logging level (output to server.log and stdout) 65 | #log4j.logger.kafka=INFO 66 | #log4j.logger.org.apache.kafka=INFO 67 | 68 | # Change to DEBUG or TRACE to enable request logging 69 | log4j.logger.kafka.request.logger=WARN, stdout 70 | log4j.additivity.kafka.request.logger=false 71 | 72 | # Uncomment the lines below and change log4j.logger.kafka.network.RequestChannel$ to TRACE for additional output 73 | # related to the handling of requests 74 | #log4j.logger.kafka.network.Processor=TRACE, requestAppender 75 | #log4j.logger.kafka.server.KafkaApis=TRACE, requestAppender 76 | #log4j.additivity.kafka.server.KafkaApis=false 77 | log4j.logger.kafka.network.RequestChannel$=WARN, stdout 78 | log4j.additivity.kafka.network.RequestChannel$=false 79 | 80 | log4j.logger.kafka.controller=TRACE, stdout 81 | log4j.additivity.kafka.controller=false 82 | 83 | log4j.logger.kafka.log.LogCleaner=INFO, stdout 84 | log4j.additivity.kafka.log.LogCleaner=false 85 | 86 | log4j.logger.state.change.logger=TRACE, stdout 87 | log4j.additivity.state.change.logger=false 88 | 89 | # Access denials are logged at INFO level, change to DEBUG to also log allowed accesses 90 | log4j.logger.kafka.authorizer.logger=AUTH, stdout 91 | log4j.additivity.kafka.authorizer.logger=false -------------------------------------------------------------------------------- /maven/3.5.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jdk:8u151 10 | 11 | LABEL MAINTAINER="Lin.Ru@msn.com" 12 | 13 | RUN apk update && \ 14 | apk upgrade && \ 15 | apk add "maven~=3.5.2" 16 | -------------------------------------------------------------------------------- /mysql/5.6.35/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/centos:7 10 | 11 | COPY run.sh / 12 | COPY init-db.sh / 13 | 14 | RUN yum update -y && \ 15 | yum install -y libaio-devel numactl-libs net-tools perl perl-Data-Dumper-Names && \ 16 | yum clean all && \ 17 | for pkg in devel shared client server; \ 18 | do rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql56-community-el7/mysql-community-$pkg-5.6.35-2.el7.x86_64.rpm; done && \ 19 | chmod 755 /run.sh /init-db.sh && rm -rf /var/lib/mysql 20 | 21 | ENTRYPOINT ["/run.sh"] 22 | -------------------------------------------------------------------------------- /mysql/5.6.35/init-db.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | # MySQL default PASSWORD 12 | m_p="KKxxmt2" 13 | 14 | dbdir="/var/lib/mysql" 15 | 16 | test -d "$dbdir/mysql" || mysql_install_db 17 | chown -R mysql:mysql $dbdir 18 | 19 | echo "Start MySQL Server" 20 | su - mysql -s /bin/bash -c "mysqld &" 21 | 22 | echo "Wait 5 seconds for MySQL start" 23 | sleep 5 24 | 25 | echo "Set password for root(defautl is: $m_p)" 26 | mysqladmin -u root password $m_p 27 | 28 | echo "Update privilege for root" 29 | mysql -u root -p$m_p -e "grant all on *.* to root@'%' identified by '$m_p' with grant option;" 30 | 31 | # Stop MySQL Server & Start MySQL Server 32 | pid=`ps aux | grep "[m]ysql" | awk '{print $2}'` 33 | kill -9 $pid 34 | -------------------------------------------------------------------------------- /mysql/5.6.35/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | if [ ! -z "$MYSQL_CONFIG_FILE" ] 14 | then 15 | test -f $MYSQL_CONFIG_FILE && cp -fv $MYSQL_CONFIG_FILE /etc/my.cnf 16 | fi 17 | 18 | d="/var/lib/mysql/mysql" 19 | 20 | test -d "$d" && chown -R mysql:mysql $d || /init-db.sh 21 | mysqld --user=mysql 22 | else 23 | "$@" 24 | fi 25 | -------------------------------------------------------------------------------- /mysql/5.7.21/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/centos:7 10 | 11 | LABEL MAINTAINER="Lin Ru " 12 | 13 | COPY run.sh / 14 | COPY init.password.sql / 15 | 16 | RUN yum update -y && \ 17 | yum install -y libaio-devel numactl-libs && \ 18 | yum clean all && \ 19 | rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/mysql-community-server-minimal-5.7.21-1.el7.x86_64.rpm && \ 20 | chmod 755 /run.sh && rm -rf /var/lib/mysql 21 | 22 | COPY my.cnf /etc/ 23 | ENTRYPOINT ["/run.sh"] 24 | -------------------------------------------------------------------------------- /mysql/5.7.21/init.password.sql: -------------------------------------------------------------------------------- 1 | ALTER USER 'root'@'localhost' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD'; 2 | GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD' WITH GRANT OPTION; -------------------------------------------------------------------------------- /mysql/5.7.21/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | no-auto-rehash 3 | 4 | [mysqld] 5 | sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER 6 | user = mysql 7 | server-id = 1 8 | gtid_mode = on 9 | enforce_gtid_consistency = 1 10 | log_slave_updates = 1 11 | skip_name_resolve 12 | expire_logs_days = 3 13 | symbolic-links = 0 14 | character-set-server = utf8 15 | back_log = 300 16 | max_connections = 10240 17 | max_connect_errors = 300 18 | max_allowed_packet = 100M 19 | max_heap_table_size = 128M 20 | binlog_cache_size = 4M 21 | sort_buffer_size = 16M 22 | join_buffer_size = 16M 23 | thread_cache_size = 32 24 | query_cache_size = 128M 25 | query_cache_limit = 4M 26 | thread_stack = 512K 27 | tmp_table_size = 128M 28 | log-bin = mysql-bin 29 | memlock 30 | max_binlog_cache_size = 64M 31 | max_binlog_size = 512M -------------------------------------------------------------------------------- /mysql/5.7.21/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | ############################################### 14 | # NOTE: DO NOT include '/' in the PASSWORD!!! # 15 | ############################################### 16 | mysql_default_password="qwe123" 17 | 18 | test -f "$MYSQL_CONFIG_FILE" && cp -fv "$MYSQL_CONFIG_FILE" /etc/my.cnf 19 | 20 | test -z "$MYSQL_RUN_USER" && MYSQL_RUN_USER="mysql" 21 | test -z "$MYSQL_RUN_GROUP" && MYSQL_RUN_GROUP="mysql" 22 | test -z "$MYSQL_DATA_DIR" && MYSQL_DATA_DIR="/var/lib/mysql" 23 | 24 | test -z "$MYSQL_ROOT_PASSWORD" && MYSQL_ROOT_PASSWORD="$mysql_default_password" 25 | 26 | test -d "$MYSQL_DATA_DIR/lost+found" && rm -rf "$MYSQL_DATA_DIR/lost+found" 27 | 28 | if [ "$MYSQL_ROLE" = "replica" ] 29 | then 30 | echo "Set Server ID to 2" 31 | sed -i "s/server-id .*/server-id = 2/" /etc/my.cnf 32 | fi 33 | 34 | if [ -d "$MYSQL_DATA_DIR/mysql" ] && [ -d "$MYSQL_DATA_DIR/sys" ] 35 | then 36 | echo "Exist mysql data detected, loading... " 37 | chown -R $MYSQL_RUN_USER:$MYSQL_RUN_GROUP $MYSQL_DATA_DIR 38 | else 39 | ips="/init.password.sql" 40 | 41 | echo "Initial new mysql" 42 | 43 | if [ ! -f $ips ] 44 | then 45 | echo "ERROR: File not found: $ips" 46 | exit 1 47 | fi 48 | 49 | echo "Replace MySQL password" 50 | 51 | sed -i "s/MYSQL_ROOT_PASSWORD/$MYSQL_ROOT_PASSWORD/" $ips 52 | 53 | echo "Initial MySQL" 54 | mysqld --initialize-insecure \ 55 | --user=$MYSQL_RUN_USER \ 56 | --datadir=$MYSQL_DATA_DIR \ 57 | --init-file=$ips 58 | 59 | test $? = 0 || exit 1 60 | 61 | test -f $ips && rm $ips && echo "Removed $ips" 62 | fi 63 | 64 | echo "Start mysqld" 65 | mysqld 66 | else 67 | "$@" 68 | fi -------------------------------------------------------------------------------- /mysql/5.7.23/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/centos:7 10 | 11 | LABEL MAINTAINER="Lin Ru " 12 | 13 | COPY run.sh / 14 | COPY init.password.sql / 15 | 16 | ENV MYSQL_VERSION 5.7.23 17 | 18 | RUN yum update -y && \ 19 | yum install -y libaio-devel numactl-libs && \ 20 | yum clean all && \ 21 | rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/mysql-community-server-minimal-${MYSQL_VERSION}-1.el7.x86_64.rpm && \ 22 | chmod 755 /run.sh && rm -rf /var/lib/mysql 23 | 24 | COPY my.cnf /etc/ 25 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /mysql/5.7.23/init.password.sql: -------------------------------------------------------------------------------- 1 | ALTER USER 'root'@'localhost' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD'; 2 | GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD' WITH GRANT OPTION; -------------------------------------------------------------------------------- /mysql/5.7.23/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | no-auto-rehash 3 | 4 | [mysqld] 5 | sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER 6 | user = mysql 7 | server-id = MYSQL_SERVER_ID 8 | gtid_mode = on 9 | enforce_gtid_consistency = 1 10 | log_slave_updates = 1 11 | skip_name_resolve 12 | expire_logs_days = 3 13 | symbolic-links = 0 14 | character-set-server = utf8 15 | back_log = 300 16 | max_connections = 10240 17 | max_connect_errors = 300 18 | max_allowed_packet = 100M 19 | max_heap_table_size = 128M 20 | binlog_cache_size = 4M 21 | sort_buffer_size = 16M 22 | join_buffer_size = 16M 23 | thread_cache_size = 32 24 | query_cache_size = 128M 25 | query_cache_limit = 4M 26 | thread_stack = 512K 27 | tmp_table_size = 128M 28 | log-bin = mysql-bin 29 | memlock 30 | max_binlog_cache_size = 64M 31 | max_binlog_size = 512M -------------------------------------------------------------------------------- /mysql/5.7.23/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | ############################################### 14 | # NOTE: DO NOT include '/' in the PASSWORD!!! # 15 | ############################################### 16 | mysql_default_password="qwe123" 17 | 18 | test -f "$MYSQL_CONFIG_FILE" && cp -fv "$MYSQL_CONFIG_FILE" /etc/my.cnf 19 | 20 | test -z "$MYSQL_RUN_USER" && MYSQL_RUN_USER="mysql" 21 | test -z "$MYSQL_RUN_GROUP" && MYSQL_RUN_GROUP="mysql" 22 | test -z "$MYSQL_DATA_DIR" && MYSQL_DATA_DIR="/var/lib/mysql" 23 | test -z "$MYSQL_SERVER_ID" && MYSQL_SERVER_ID=$RANDOM 24 | 25 | test -z "$MYSQL_ROOT_PASSWORD" && MYSQL_ROOT_PASSWORD="$mysql_default_password" 26 | 27 | test -d "$MYSQL_DATA_DIR/lost+found" && rm -rf "$MYSQL_DATA_DIR/lost+found" 28 | 29 | sed -i "s/MYSQL_SERVER_ID/$MYSQL_SERVER_ID/" /etc/my.cnf 30 | 31 | if [ -d "$MYSQL_DATA_DIR/mysql" ] && [ -d "$MYSQL_DATA_DIR/sys" ] 32 | then 33 | echo "Exist mysql data detected, loading... " 34 | chown -R $MYSQL_RUN_USER:$MYSQL_RUN_GROUP $MYSQL_DATA_DIR 35 | else 36 | ips="/init.password.sql" 37 | 38 | echo "Initial new mysql" 39 | 40 | if [ ! -f $ips ] 41 | then 42 | echo "ERROR: File not found: $ips" 43 | exit 1 44 | fi 45 | 46 | echo "Replace MySQL password" 47 | 48 | sed -i "s/MYSQL_ROOT_PASSWORD/$MYSQL_ROOT_PASSWORD/" $ips 49 | 50 | echo "Initial MySQL" 51 | mysqld --initialize-insecure \ 52 | --user=$MYSQL_RUN_USER \ 53 | --datadir=$MYSQL_DATA_DIR \ 54 | --init-file=$ips 55 | 56 | test $? = 0 || exit 1 57 | 58 | test -f $ips && rm $ips && echo "Removed $ips" 59 | fi 60 | 61 | echo "Start mysqld" 62 | mysqld 63 | else 64 | "$@" 65 | fi -------------------------------------------------------------------------------- /mysql/5.7.24/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/centos:7 10 | 11 | LABEL MAINTAINER="Lin Ru " 12 | 13 | COPY run.sh / 14 | COPY init.password.sql / 15 | 16 | ENV MYSQL_VERSION 5.7.24 17 | 18 | RUN yum update -y && \ 19 | yum install -y libaio-devel numactl-libs && \ 20 | yum clean all && \ 21 | rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7/mysql-community-server-minimal-${MYSQL_VERSION}-1.el7.x86_64.rpm && \ 22 | chmod 755 /run.sh && rm -rf /var/lib/mysql 23 | 24 | COPY my.cnf /etc/ 25 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /mysql/5.7.24/init.password.sql: -------------------------------------------------------------------------------- 1 | ALTER USER 'root'@'localhost' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD'; 2 | GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD' WITH GRANT OPTION; -------------------------------------------------------------------------------- /mysql/5.7.24/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | no-auto-rehash 3 | 4 | [mysqld] 5 | sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER 6 | user = mysql 7 | server-id = MYSQL_SERVER_ID 8 | gtid_mode = on 9 | enforce_gtid_consistency = 1 10 | log_slave_updates = 1 11 | skip_name_resolve 12 | expire_logs_days = 3 13 | symbolic-links = 0 14 | character-set-server = utf8 15 | back_log = 300 16 | max_connections = 10240 17 | max_connect_errors = 300 18 | max_allowed_packet = 100M 19 | max_heap_table_size = 128M 20 | binlog_cache_size = 4M 21 | sort_buffer_size = 16M 22 | join_buffer_size = 16M 23 | thread_cache_size = 32 24 | query_cache_size = 128M 25 | query_cache_limit = 4M 26 | thread_stack = 512K 27 | tmp_table_size = 128M 28 | log-bin = mysql-bin 29 | memlock 30 | max_binlog_cache_size = 64M 31 | max_binlog_size = 512M -------------------------------------------------------------------------------- /mysql/5.7.24/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | ############################################### 14 | # NOTE: DO NOT include '/' in the PASSWORD!!! # 15 | ############################################### 16 | mysql_default_password="qwe123" 17 | 18 | test -f "$MYSQL_CONFIG_FILE" && cp -fv "$MYSQL_CONFIG_FILE" /etc/my.cnf 19 | 20 | test -z "$MYSQL_RUN_USER" && MYSQL_RUN_USER="mysql" 21 | test -z "$MYSQL_RUN_GROUP" && MYSQL_RUN_GROUP="mysql" 22 | test -z "$MYSQL_DATA_DIR" && MYSQL_DATA_DIR="/var/lib/mysql" 23 | test -z "$MYSQL_SERVER_ID" && MYSQL_SERVER_ID=$RANDOM 24 | 25 | test -z "$MYSQL_ROOT_PASSWORD" && MYSQL_ROOT_PASSWORD="$mysql_default_password" 26 | 27 | test -d "$MYSQL_DATA_DIR/lost+found" && rm -rf "$MYSQL_DATA_DIR/lost+found" 28 | 29 | sed -i "s/MYSQL_SERVER_ID/$MYSQL_SERVER_ID/" /etc/my.cnf 30 | 31 | if [ -d "$MYSQL_DATA_DIR/mysql" ] && [ -d "$MYSQL_DATA_DIR/sys" ] 32 | then 33 | echo "Exist mysql data detected, loading... " 34 | chown -R $MYSQL_RUN_USER:$MYSQL_RUN_GROUP $MYSQL_DATA_DIR 35 | else 36 | ips="/init.password.sql" 37 | 38 | echo "Initial new mysql" 39 | 40 | if [ ! -f $ips ] 41 | then 42 | echo "ERROR: File not found: $ips" 43 | exit 1 44 | fi 45 | 46 | echo "Replace MySQL password" 47 | 48 | sed -i "s/MYSQL_ROOT_PASSWORD/$MYSQL_ROOT_PASSWORD/" $ips 49 | 50 | echo "Initial MySQL" 51 | mysqld --initialize-insecure \ 52 | --user=$MYSQL_RUN_USER \ 53 | --datadir=$MYSQL_DATA_DIR \ 54 | --init-file=$ips 55 | 56 | test $? = 0 || exit 1 57 | 58 | test -f $ips && rm $ips && echo "Removed $ips" 59 | fi 60 | 61 | echo "Start mysqld" 62 | mysqld 63 | else 64 | "$@" 65 | fi -------------------------------------------------------------------------------- /mysql/5.7.30/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Lin Ru, 2018.01.06 3 | # Lin.Ru@msn.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM centos:7 10 | 11 | RUN yum update -y && \ 12 | yum install -y libaio-devel numactl-libs && \ 13 | yum clean all && \ 14 | yum install -y http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.30-1.el7.x86_64.rpm && \ 15 | mkdir -p /etc/mysql && \ 16 | rm -rf /var/lib/mysql /var/tmp/* 17 | 18 | COPY run.sh / 19 | COPY my.cnf /etc/mysql 20 | COPY init.sql /usr/share/mysql 21 | 22 | RUN chmod 755 /run.sh && \ 23 | mkdir -p /var/lib/mysql && \ 24 | touch /etc/my.exxtra.cnf && \ 25 | chown -R mysql /etc/mysql /var/lib/mysql 26 | 27 | USER mysql 28 | 29 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /mysql/5.7.30/init.sql: -------------------------------------------------------------------------------- 1 | ALTER USER 'root'@'localhost' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD'; 2 | GRANT ALL ON *.* TO root@'%' IDENTIFIED BY 'MYSQL_ROOT_PASSWORD' WITH GRANT OPTION; 3 | 4 | GRANT SELECT ON mysql.db TO health_check@'%' IDENTIFIED BY 'MYSQL_HC_PASSWORD'; -------------------------------------------------------------------------------- /mysql/5.7.30/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | no-auto-rehash 3 | socket = /tmp/mysql.sock 4 | 5 | [mysqld] 6 | datadir = /data/mysql 7 | socket = /tmp/mysql.sock 8 | sql_mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER 9 | user = mysql 10 | server-id = MYSQL_SERVER_ID 11 | gtid_mode = on 12 | enforce_gtid_consistency = 1 13 | log_slave_updates = 1 14 | skip-name-resolve 15 | skip-host-cache 16 | expire_logs_days = 3 17 | symbolic-links = 0 18 | character-set-server = utf8 19 | back_log = 300 20 | max_connections = 3000 21 | max_connect_errors = 300 22 | max_allowed_packet = 100M 23 | max_heap_table_size = 128M 24 | binlog_cache_size = 4M 25 | sort_buffer_size = 16M 26 | join_buffer_size = 16M 27 | thread_cache_size = 32 28 | query_cache_size = 128M 29 | query_cache_limit = 4M 30 | thread_stack = 512K 31 | tmp_table_size = 128M 32 | log-bin = mysql-bin 33 | memlock 34 | max_binlog_cache_size = 64M 35 | max_binlog_size = 512M -------------------------------------------------------------------------------- /mysql/5.7.30/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Lin Ru, 2018.01.06 5 | # Lin.Ru@msn.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | ############################################### 14 | # NOTE: DO NOT include '/' in the PASSWORD!!! # 15 | ############################################### 16 | conf="/etc/mysql/my.cnf" 17 | mysql_default_password="X75b6bK68Zf3761" 18 | MYSQL_DATA_DIR="/data/mysql" 19 | MYSQL_SERVER_ID="$RANDOM" 20 | 21 | test -z "$MYSQL_RUN_OPTS" && MYSQL_RUN_OPTS="--datadir=$MYSQL_DATA_DIR --user=mysql" 22 | test -z "$MYSQL_ROOT_PASSWORD" && MYSQL_ROOT_PASSWORD="$mysql_default_password" 23 | 24 | if [ -d "$MYSQL_DATA_DIR/mysql" ] && [ -d "$MYSQL_DATA_DIR/sys" ] 25 | then 26 | echo "Exist MySQL data detected, loading... " 27 | chown -R $MYSQL_USER:$MYSQL_GROUP $MYSQL_DATA_DIR 28 | else 29 | irp="/usr/share/mysql/init.sql" 30 | ips="/tmp/mysql.init.sql" 31 | echo "Initial NEW MySQL" 32 | 33 | sed -i "s/MYSQL_SERVER_ID/$MYSQL_SERVER_ID/" $conf 34 | 35 | if [ "$MYSQL_RUN_ROLE" = "MM" ] 36 | then 37 | grep -q auto_increment_increment $conf 38 | test $? = 1 && echo 'auto_increment_increment=2' >> $conf 39 | 40 | # Require Kubernetes STATEFULSET 41 | grep -q '^auto_increment_offset' $conf 42 | 43 | if [ $? = 1 ] 44 | then 45 | # set mm-0 offset=1, others to 2 46 | test ${HOSTNAME##*-} -gt 0 && offset=2 || offset=1 47 | echo "auto_increment_offset=$offset" >> $conf 48 | fi 49 | fi 50 | 51 | cp -rfv $irp $ips 52 | 53 | echo "Update MySQL root Password" 54 | 55 | sed -i "s/MYSQL_ROOT_PASSWORD/$MYSQL_ROOT_PASSWORD/" $ips 56 | sed -i "s/MYSQL_HC_PASSWORD/$MYSQL_HC_PASSWORD/" $ips 57 | 58 | echo "Initial MySQL" 59 | mysqld --initialize-insecure --init-file=$ips $MYSQL_RUN_OPTS 60 | 61 | test $? = 0 || exit 1 62 | 63 | test -f $ips && rm -f $ips && echo "Removed $ips" 64 | fi 65 | 66 | echo "`date +'%F %T'` Start mysqld" 67 | exec mysqld --defaults-file=$conf --defaults-extra-file=/etc/my.extra.cnf 68 | else 69 | exec "$@" 70 | fi -------------------------------------------------------------------------------- /nginx/1.12.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | COPY files / 12 | 13 | RUN apk update && \ 14 | apk upgrade && \ 15 | apk add "nginx~=1.12.2" && \ 16 | chmod 755 /run.sh 17 | 18 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /nginx/1.12.2/files/etc/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nobody; 2 | #worker_processes 4; 3 | worker_rlimit_nofile 65535; 4 | 5 | daemon off; 6 | 7 | events { 8 | use epoll; 9 | worker_connections 65535; 10 | } 11 | 12 | http { 13 | include mime.types; 14 | default_type application/octet-stream; 15 | 16 | log_format default '$remote_addr $remote_port $remote_user $time_iso8601 $status $body_bytes_sent ' 17 | '"$request" "$request_body" "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'; 18 | 19 | fastcgi_connect_timeout 300; 20 | fastcgi_send_timeout 300; 21 | fastcgi_read_timeout 300; 22 | fastcgi_buffer_size 64k; 23 | fastcgi_buffers 8 32k; 24 | fastcgi_busy_buffers_size 128k; 25 | fastcgi_temp_file_write_size 128k; 26 | 27 | sendfile on; 28 | keepalive_timeout 65; 29 | gzip on; 30 | gzip_min_length 1k; 31 | gzip_buffers 4 16k; 32 | gzip_http_version 1.0; 33 | gzip_comp_level 2; 34 | gzip_types text/plain application/x-javascript text/css application/xml text/vnd.wap.wml; 35 | gzip_vary on; 36 | open_file_cache max=32768 inactive=20s; 37 | open_file_cache_min_uses 1; 38 | open_file_cache_valid 30s; 39 | 40 | proxy_ignore_client_abort on; 41 | 42 | client_max_body_size 1G; 43 | client_body_buffer_size 256k; 44 | proxy_connect_timeout 30; 45 | proxy_send_timeout 30; 46 | proxy_read_timeout 60; 47 | proxy_buffer_size 256k; 48 | proxy_buffers 4 256k; 49 | proxy_busy_buffers_size 256k; 50 | proxy_temp_file_write_size 256k; 51 | proxy_http_version 1.1; 52 | 53 | include vhosts/*.conf; 54 | } -------------------------------------------------------------------------------- /nginx/1.12.2/files/etc/nginx/vhosts/default.conf: -------------------------------------------------------------------------------- 1 | # This is a default site configuration which will simply return 404, preventing 2 | # chance access to any other virtualhost. 3 | 4 | server { 5 | listen 80 default_server; 6 | listen [::]:80 default_server; 7 | 8 | # Everything is a 404 9 | location / { 10 | return 404; 11 | } 12 | 13 | # You may need this to prevent return 404 recursion. 14 | location = /404.html { 15 | internal; 16 | } 17 | } -------------------------------------------------------------------------------- /nginx/1.12.2/files/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if [ -z "$@" ] 4 | then 5 | echo "Start nginx" 6 | 7 | test -d "/run/nginx" || mkdir -p /run/nginx 8 | 9 | nginx 10 | else 11 | "$@" 12 | fi -------------------------------------------------------------------------------- /nginx/1.14.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.8 2 | 3 | COPY files / 4 | 5 | RUN apk update && \ 6 | apk upgrade && \ 7 | apk add "nginx~=1.14.0" && \ 8 | chmod 755 /run.sh 9 | 10 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /nginx/1.14.0/files/etc/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user nobody; 2 | worker_rlimit_nofile 65535; 3 | 4 | daemon off; 5 | 6 | events { 7 | use epoll; 8 | worker_connections 65535; 9 | } 10 | 11 | http { 12 | include mime.types; 13 | default_type application/octet-stream; 14 | 15 | log_format default '$remote_addr $remote_port $remote_user $time_iso8601 $status $body_bytes_sent ' 16 | '"$request" "$request_body" "$http_referer" "$http_user_agent" "$http_x_forwarded_for"'; 17 | 18 | fastcgi_connect_timeout 300; 19 | fastcgi_send_timeout 300; 20 | fastcgi_read_timeout 300; 21 | fastcgi_buffer_size 64k; 22 | fastcgi_buffers 8 32k; 23 | fastcgi_busy_buffers_size 128k; 24 | fastcgi_temp_file_write_size 128k; 25 | 26 | sendfile on; 27 | keepalive_timeout 65; 28 | gzip on; 29 | gzip_min_length 1k; 30 | gzip_buffers 4 16k; 31 | gzip_http_version 1.0; 32 | gzip_comp_level 2; 33 | gzip_types text/plain application/x-javascript text/css application/xml text/vnd.wap.wml; 34 | gzip_vary on; 35 | open_file_cache max=32768 inactive=20s; 36 | open_file_cache_min_uses 1; 37 | open_file_cache_valid 30s; 38 | 39 | proxy_ignore_client_abort on; 40 | 41 | client_max_body_size 1G; 42 | client_body_buffer_size 256k; 43 | proxy_connect_timeout 30; 44 | proxy_send_timeout 30; 45 | proxy_read_timeout 60; 46 | proxy_buffer_size 256k; 47 | proxy_buffers 4 256k; 48 | proxy_busy_buffers_size 256k; 49 | proxy_temp_file_write_size 256k; 50 | proxy_http_version 1.1; 51 | 52 | include vhosts/*.conf; 53 | } -------------------------------------------------------------------------------- /nginx/1.14.0/files/etc/nginx/vhosts/default.conf: -------------------------------------------------------------------------------- 1 | # This is a default site configuration which will simply return 404, preventing 2 | # chance access to any other virtualhost. 3 | 4 | server { 5 | listen 80 default_server; 6 | listen [::]:80 default_server; 7 | 8 | # Everything is a 404 9 | location / { 10 | return 404; 11 | } 12 | 13 | # You may need this to prevent return 404 recursion. 14 | location = /404.html { 15 | internal; 16 | } 17 | } -------------------------------------------------------------------------------- /nginx/1.14.0/files/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | if [ -z "$@" ] 4 | then 5 | echo "Start nginx" 6 | 7 | test -d "/run/nginx" || mkdir -p /run/nginx 8 | 9 | nginx 10 | else 11 | "$@" 12 | fi -------------------------------------------------------------------------------- /nodejs/8.11.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.8 2 | 3 | RUN apk update && \ 4 | apk upgrade && \ 5 | apk add "nodejs~=8.11.4" && \ 6 | apk add "npm~=8.11.4" && \ 7 | cd /usr/lib && npm i cross-env -------------------------------------------------------------------------------- /nodejs/8.12.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:edge 2 | 3 | RUN apk update && \ 4 | apk upgrade && \ 5 | apk add "nodejs~=8.12.0" && \ 6 | apk add "npm~=8.12.0" && \ 7 | cd /usr/lib && npm i cross-env -------------------------------------------------------------------------------- /nodejs/8.9.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.7 2 | 3 | COPY job.sh / 4 | RUN apk update && \ 5 | apk upgrade && \ 6 | chmod 755 /job.sh && \ 7 | apk add "nodejs~=8.9.3" && \ 8 | cd /usr/lib && npm i cross-env -------------------------------------------------------------------------------- /nodejs/8.9.3/job.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # For kubernetes Cron Job 4 | # Created by Lin.Ru@msn.com, 2018-06-02 5 | 6 | msg(){ 7 | echo -e "`date +'%F %T'` $1" 8 | } 9 | 10 | msg "Job type: $APP_JOB_TYPE, id $CRONJOB_ID" 11 | 12 | msg "Change dir into $APP_ROOT" 13 | cd $APP_ROOT 14 | 15 | cj="cronjob.json" 16 | name="`jq \".[] | select(.id == $CRONJOB_ID) | .name\" $cj | sed 's/"//g'`" 17 | 18 | if [ "$CRONJOB_NAME" != "$name" ] 19 | then 20 | msg "Task names are inconsistent !" 21 | send "failure-task-name-inconsistent" 22 | exit 0 23 | fi 24 | 25 | echo "`date +'%F %T'` Execute command: `jq \".[] | select(.id == $CRONJOB_ID) | .command\" $cj | sed 's/"//g'`" 26 | 27 | jq ".[] | select(.id == $CRONJOB_ID) | .command" $cj | sed 's/"//g' | sh 28 | 29 | if [ $? = 0 ] 30 | then 31 | msg "Command successfully completed" 32 | exit 0 33 | else 34 | msg "Command failed" 35 | exit 0 36 | fi -------------------------------------------------------------------------------- /nodejs/9.11.1/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/centos:7 2 | 3 | RUN yum update -y && \ 4 | yum clean all && \ 5 | dir="/usr/local/nodejs" && \ 6 | ver="v9.11.1" && \ 7 | app="node-$ver-linux-x64" && \ 8 | curl https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/$ver/$app.tar.gz | tar zxf - && \ 9 | mv $app $dir && \ 10 | chown -R root:root $dir && \ 11 | chmod -R 777 /data/logs/ && \ 12 | ln -s $dir/bin/node /usr/local/bin/node && \ 13 | ln -s $dir/bin/npm /usr/local/bin/npm && \ 14 | echo "export PATH=$PATH:$dir/bin" >> /etc/bashrc -------------------------------------------------------------------------------- /php/7.1.17/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.7 2 | 3 | LABEL MAINTAINER="Lin.Ru@msn.com" 4 | 5 | ENV BUILD_TOOLS="m4 autoconf gcc g++ make file bash" \ 6 | PHP_LOG="/data/logs/php" \ 7 | PHP_VERSION="7.1.17" \ 8 | PHP_REDIS_V="3.1.4" \ 9 | PHP_DEPS="libxml2 libxml2-dev openssl openssl-dev \ 10 | bzip2 bzip2-dev libcurl curl-dev re2c libevent \ 11 | libjpeg-turbo libjpeg-turbo-dev libpng libpng-dev \ 12 | libevent-dev \ 13 | freetype freetype-dev readline readline-dev \ 14 | libmcrypt libmcrypt-dev libxslt libxslt-dev" 15 | ENV PHP_REDIS="php7-redis~=$PHP_REDIS_V" \ 16 | PHP_EXTS="bcmath bz2 calendar ctype curl dba dom exif \ 17 | fileinfo gd gettext gmp iconv json mbstring \ 18 | mcrypt mysqli pdo_mysql pdo_sqlite pcntl phar \ 19 | posix shmop simplexml soap sockets sqlite3 \ 20 | sysvmsg sysvshm sysvsem tokenizer wddx opcache \ 21 | xml xmlreader xmlwriter xmlrpc xsl zip pear" \ 22 | PHP_PKGS="php7~=$PHP_VERSION php7-dev~=$PHP_VERSION php7-fpm~=$PHP_VERSION" 23 | 24 | RUN apk update && \ 25 | apk upgrade && \ 26 | apk add $SYSTEM_CMDS && \ 27 | apk add $PHP_DEPS $BUILD_TOOLS && \ 28 | apk add $PHP_PKGS $PHP_REDIS && \ 29 | for i in $PHP_EXTS;do apk add php7-$i;done && \ 30 | apk del $BUILD_TOOLS && \ 31 | test -d "$PHP_LOG" || mkdir -p "$PHP_LOG" && \ 32 | rm -rf /t /tmp/* 33 | 34 | COPY files / 35 | 36 | ENV SYSTEM_CMDS="" BUILD_TOOLS="" PHP_PKGS="" \ 37 | PHP_REDIS_V="" PHP_DEPS="" PHP_REDIS="" \ 38 | PHP_EXTS="" -------------------------------------------------------------------------------- /php/7.1.17/files/etc/php7/php-fpm.conf: -------------------------------------------------------------------------------- 1 | [global] 2 | pid = /run/php-fpm.pid 3 | error_log = /data/logs/php/php-error.log 4 | 5 | log_level = warning 6 | daemonize = no 7 | include=/etc/php7/php-fpm.d/*.conf 8 | -------------------------------------------------------------------------------- /php/7.1.17/files/etc/php7/php-fpm.d/www.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | user = nobody 3 | group = nobody 4 | listen = 127.0.0.1:9000 5 | pm = static 6 | pm.max_children = 4 7 | pm.start_servers = 4 8 | pm.min_spare_servers = 4 9 | pm.max_spare_servers = 4 10 | pm.max_requests = 5000 11 | pm.status_path = /status 12 | catch_workers_output = yes 13 | slowlog = /data/logs/php/php-slow.log 14 | request_slowlog_timeout = 1 15 | php_flag[display_errors] = off 16 | php_admin_value[error_log] = /data/logs/php/php-error.log 17 | php_admin_flag[log_errors] = on 18 | php_admin_value[memory_limit] = 32M 19 | php_value[session.save_handler] = files 20 | php_value[session.save_path] = /var/lib/php7/session 21 | php_value[soap.wsdl_cache_dir] = /var/lib/php7/wsdlcache 22 | -------------------------------------------------------------------------------- /php/7.1.17/files/etc/php7/php.ini: -------------------------------------------------------------------------------- 1 | [PHP] 2 | engine = On 3 | short_open_tag = Off 4 | precision = 14 5 | output_buffering = 4096 6 | zlib.output_compression = Off 7 | implicit_flush = Off 8 | unserialize_callback_func = 9 | serialize_precision = -1 10 | disable_functions = 11 | disable_classes = 12 | zend.enable_gc = On 13 | expose_php = On 14 | max_execution_time = 30 15 | max_input_time = 60 16 | memory_limit = 128M 17 | error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT 18 | display_errors = Off 19 | display_startup_errors = Off 20 | log_errors = On 21 | log_errors_max_len = 1024 22 | ignore_repeated_errors = Off 23 | ignore_repeated_source = Off 24 | report_memleaks = On 25 | track_errors = Off 26 | html_errors = On 27 | variables_order = "GPCS" 28 | request_order = "GP" 29 | register_argc_argv = Off 30 | auto_globals_jit = On 31 | post_max_size = 8M 32 | auto_prepend_file = 33 | auto_append_file = 34 | default_mimetype = "text/html" 35 | default_charset = "UTF-8" 36 | doc_root = 37 | user_dir = 38 | enable_dl = Off 39 | file_uploads = On 40 | upload_max_filesize = 200M 41 | max_file_uploads = 20 42 | allow_url_fopen = On 43 | allow_url_include = Off 44 | default_socket_timeout = 60 45 | [CLI Server] 46 | cli_server.color = On 47 | [Date] 48 | [filter] 49 | [iconv] 50 | [intl] 51 | [sqlite3] 52 | [Pcre] 53 | [Pdo] 54 | [Pdo_mysql] 55 | pdo_mysql.cache_size = 2000 56 | pdo_mysql.default_socket= 57 | [Phar] 58 | [mail function] 59 | SMTP = localhost 60 | smtp_port = 25 61 | mail.add_x_header = On 62 | [SQL] 63 | sql.safe_mode = Off 64 | [ODBC] 65 | odbc.allow_persistent = On 66 | odbc.check_persistent = On 67 | odbc.max_persistent = -1 68 | odbc.max_links = -1 69 | odbc.defaultlrl = 4096 70 | odbc.defaultbinmode = 1 71 | [Interbase] 72 | ibase.allow_persistent = 1 73 | ibase.max_persistent = -1 74 | ibase.max_links = -1 75 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S" 76 | ibase.dateformat = "%Y-%m-%d" 77 | ibase.timeformat = "%H:%M:%S" 78 | [MySQLi] 79 | mysqli.max_persistent = -1 80 | mysqli.allow_persistent = On 81 | mysqli.max_links = -1 82 | mysqli.cache_size = 2000 83 | mysqli.default_port = 3306 84 | mysqli.default_socket = 85 | mysqli.default_host = 86 | mysqli.default_user = 87 | mysqli.default_pw = 88 | mysqli.reconnect = Off 89 | [mysqlnd] 90 | mysqlnd.collect_statistics = On 91 | mysqlnd.collect_memory_statistics = Off 92 | [OCI8] 93 | [PostgreSQL] 94 | pgsql.allow_persistent = On 95 | pgsql.auto_reset_persistent = Off 96 | pgsql.max_persistent = -1 97 | pgsql.max_links = -1 98 | pgsql.ignore_notice = 0 99 | pgsql.log_notice = 0 100 | [bcmath] 101 | bcmath.scale = 0 102 | [browscap] 103 | [Session] 104 | session.save_handler = files 105 | session.use_strict_mode = 0 106 | session.use_cookies = 1 107 | session.use_only_cookies = 1 108 | session.name = PHPSESSID 109 | session.auto_start = 0 110 | session.cookie_lifetime = 0 111 | session.cookie_path = / 112 | session.cookie_domain = 113 | session.cookie_httponly = 114 | session.serialize_handler = php 115 | session.gc_probability = 1 116 | session.gc_divisor = 1000 117 | session.gc_maxlifetime = 1440 118 | session.referer_check = 119 | session.cache_limiter = nocache 120 | session.cache_expire = 180 121 | session.use_trans_sid = 0 122 | session.sid_length = 26 123 | session.trans_sid_tags = "a=href,area=href,frame=src,form=" 124 | session.sid_bits_per_character = 5 125 | [Assertion] 126 | zend.assertions = -1 127 | [COM] 128 | [mbstring] 129 | [gd] 130 | [exif] 131 | [Tidy] 132 | tidy.clean_output = Off 133 | [soap] 134 | soap.wsdl_cache_enabled=1 135 | soap.wsdl_cache_dir="/tmp" 136 | soap.wsdl_cache_ttl=86400 137 | soap.wsdl_cache_limit = 5 138 | [sysvshm] 139 | [ldap] 140 | ldap.max_links = -1 141 | [mcrypt] 142 | [dba] 143 | [opcache] 144 | opcache.enable=1 145 | opcache.enable_cli=1 146 | opcache.memory_consumption=512 147 | opcache.interned_strings_buffer=64 148 | opcache.max_accelerated_files=30000 149 | opcache.validate_timestamps=1 150 | opcache.revalidate_freq=300 151 | opcache.revalidate_path=0 152 | opcache.fast_shutdown=1 153 | opcache.huge_code_pages=1 154 | [curl] 155 | [openssl] 156 | -------------------------------------------------------------------------------- /postgres/10.4-alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM postgres:10.4-alpine -------------------------------------------------------------------------------- /python/2.7.14/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.7 2 | 3 | COPY job.sh / 4 | 5 | RUN apk update && \ 6 | apk upgrade && \ 7 | c="gcc make autoconf g++ python2-dev mysql-dev" && \ 8 | pi="mirrors.aliyun.com" && \ 9 | ps="http://$pi/pypi/simple" && \ 10 | args="-i $ps --trusted-host=$pi" && \ 11 | apk add "python2~=2.7.14" py2-pip $c jq && \ 12 | pip install --upgrade pip $args && \ 13 | pip install ssh toml MySQL-python==1.2.5 $args && \ 14 | cp /usr/lib/libmysqlclient.so.18 / && \ 15 | apk del $c && \ 16 | mv /libmysqlclient.so.18 /usr/lib && \ 17 | chmod 755 /job.sh -------------------------------------------------------------------------------- /python/2.7.14/job.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # For kubernetes Cron Job 4 | # Created by Lin.Ru@msn.com, 2018-06-02 5 | 6 | msg(){ 7 | echo -e "`date +'%F %T'` $1" 8 | } 9 | 10 | msg "Job type: $APP_JOB_TYPE, id $CRONJOB_ID" 11 | 12 | msg "Change dir into $APP_ROOT" 13 | cd $APP_ROOT 14 | 15 | cj="cronjob.json" 16 | name="`jq \".[] | select(.id == $CRONJOB_ID) | .name\" $cj | sed 's/"//g'`" 17 | 18 | if [ "$CRONJOB_NAME" != "$name" ] 19 | then 20 | msg "Task names are inconsistent !" 21 | send "failure-task-name-inconsistent" 22 | exit 0 23 | fi 24 | 25 | echo "`date +'%F %T'` Execute command: `jq \".[] | select(.id == $CRONJOB_ID) | .command\" $cj | sed 's/"//g'`" 26 | 27 | jq ".[] | select(.id == $CRONJOB_ID) | .command" $cj | sed 's/"//g' | sh 28 | 29 | if [ $? = 0 ] 30 | then 31 | msg "Command successfully completed" 32 | exit 0 33 | else 34 | msg "Command failed" 35 | exit 0 36 | fi -------------------------------------------------------------------------------- /python/3.6.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.7 2 | 3 | COPY job.sh / 4 | 5 | RUN apk update && \ 6 | apk upgrade && \ 7 | pi="mirrors.aliyun.com" && \ 8 | ps="http://$pi/pypi/simple" && \ 9 | args="-i $ps --trusted-host=$pi" && \ 10 | apk add "python3~=3.6.3" py3-pip jq && \ 11 | chmod 755 /job.sh && \ 12 | pip3 install --upgrade pip $agrs -------------------------------------------------------------------------------- /python/3.6.3/job.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # For kubernetes Cron Job 4 | # Created by Lin.Ru@msn.com, 2018-06-02 5 | 6 | msg(){ 7 | echo -e "`date +'%F %T'` $1" 8 | } 9 | 10 | msg "Job type: $APP_JOB_TYPE, id $CRONJOB_ID" 11 | 12 | msg "Change dir into $APP_ROOT" 13 | cd $APP_ROOT 14 | 15 | cj="cronjob.json" 16 | name="`jq \".[] | select(.id == $CRONJOB_ID) | .name\" $cj | sed 's/"//g'`" 17 | 18 | if [ "$CRONJOB_NAME" != "$name" ] 19 | then 20 | msg "Task names are inconsistent !" 21 | send "failure-task-name-inconsistent" 22 | exit 0 23 | fi 24 | 25 | echo "`date +'%F %T'` Execute command: `jq \".[] | select(.id == $CRONJOB_ID) | .command\" $cj | sed 's/"//g'`" 26 | 27 | jq ".[] | select(.id == $CRONJOB_ID) | .command" $cj | sed 's/"//g' | sh 28 | 29 | if [ $? = 0 ] 30 | then 31 | msg "Command successfully completed" 32 | exit 0 33 | else 34 | msg "Command failed" 35 | exit 0 36 | fi -------------------------------------------------------------------------------- /python/3.6.5-centos/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/centos:7 2 | 3 | LABEL MAINTAINER="Lin.Ru@msn.com" 4 | 5 | COPY job.sh / 6 | 7 | RUN yum makecache && \ 8 | yum update -y && \ 9 | yum install -y make gcc zlib-devel glibc-devel \ 10 | cpp glibc-headers libmpc \ 11 | kernel-headers mpfr libgomp \ 12 | openssl-devel && \ 13 | ver="3.6.5" && \ 14 | pkg="Python-$ver" && \ 15 | cd /tmp && \ 16 | curl -L https://www.python.org/ftp/python/$ver/$pkg.tgz | \ 17 | tar zxf - && \ 18 | cd $pkg && \ 19 | LDFLAGS=-L/usr/lib64 CPPFLAGS=-I/usr/include \ 20 | ./configure --enable-ipv6 --with-ensurepip=install && \ 21 | make && \ 22 | make install && \ 23 | rm -rf /tmp/* && \ 24 | chmod 755 /job.sh && \ 25 | pip3 install --upgrade pip -------------------------------------------------------------------------------- /python/3.6.5-centos/job.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # For kubernetes Cron Job 4 | # Created by Lin.Ru@msn.com, 2018-06-02 5 | 6 | msg(){ 7 | echo -e "`date +'%F %T'` $1" 8 | } 9 | 10 | msg "Job type: $APP_JOB_TYPE, id $CRONJOB_ID" 11 | 12 | msg "Change dir into $APP_ROOT" 13 | cd $APP_ROOT 14 | 15 | cj="cronjob.json" 16 | name="`jq \".[] | select(.id == $CRONJOB_ID) | .name\" $cj | sed 's/"//g'`" 17 | 18 | if [ "$CRONJOB_NAME" != "$name" ] 19 | then 20 | msg "Task names are inconsistent !" 21 | send "failure-task-name-inconsistent" 22 | exit 0 23 | fi 24 | 25 | echo "`date +'%F %T'` Execute command: `jq \".[] | select(.id == $CRONJOB_ID) | .command\" $cj | sed 's/"//g'`" 26 | 27 | jq ".[] | select(.id == $CRONJOB_ID) | .command" $cj | sed 's/"//g' | sh 28 | 29 | if [ $? = 0 ] 30 | then 31 | msg "Command successfully completed" 32 | exit 0 33 | else 34 | msg "Command failed" 35 | exit 0 36 | fi -------------------------------------------------------------------------------- /redis/4.0.10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.7 2 | 3 | LABEL Maintainer="Lin.Ru@msn.com" 4 | 5 | COPY run.sh / 6 | 7 | ENV REDIS_DIRS="/var/lib/redis /var/run/redis /var/log/redis" \ 8 | REDIS_CONF="/etc/redis.conf" 9 | 10 | RUN apk update && \ 11 | apk upgrade && \ 12 | apk add "redis~=4.0.10" && \ 13 | chmod -v 755 /run.sh && \ 14 | sed -i 's/^bind .*/bind 0.0.0.0/' $REDIS_CONF && \ 15 | sed -i 's/^daemonize .*/daemonize no/' $REDIS_CONF && \ 16 | chown 1000 $REDIS_DIRS 17 | 18 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /redis/4.0.10/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | conf=/etc/redis.conf 14 | 15 | if [ -z "$REDIS_PASSWORD" ] 16 | then 17 | echo "Redis password auth is disabled" 18 | else 19 | echo "Redis password auth is ENABLED." 20 | 21 | echo "$REDIS_PASSWORD" | egrep -qi "enable|true|random|yes" 22 | if [ $? = 0 ] 23 | then 24 | REDIS_PASSWORD="`cat /dev/urandom | sed 's/[^a-zA-Z0-9]//g' | strings -n 12 | head -1`" 25 | fi 26 | 27 | echo "requirepass \"$REDIS_PASSWORD\"" >> $conf 28 | fi 29 | 30 | # Start Redis Server 31 | redis-server $conf 32 | else 33 | "$@" 34 | fi -------------------------------------------------------------------------------- /redis/4.0.11/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.8 2 | 3 | LABEL Maintainer="Lin.Ru@msn.com" 4 | 5 | COPY run.sh / 6 | 7 | ENV REDIS_DIRS="/var/lib/redis /var/run/redis /var/log/redis" \ 8 | REDIS_CONF="/etc/redis.conf" 9 | 10 | RUN apk update && \ 11 | apk upgrade && \ 12 | apk add "redis~=4.0.11" && \ 13 | chmod -v 755 /run.sh && \ 14 | sed -i 's/^bind .*/bind 0.0.0.0/' $REDIS_CONF && \ 15 | sed -i 's/^daemonize .*/daemonize no/' $REDIS_CONF && \ 16 | chown 1000 $REDIS_DIRS 17 | 18 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /redis/4.0.11/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | conf=/etc/redis.conf 14 | pass=/var/lib/redis/password 15 | 16 | if [ -z "$REDIS_PASSWORD" ] 17 | then 18 | echo "Redis password auth is disabled" 19 | else 20 | echo "Redis password auth is ENABLED." 21 | if [ -f $pass ] 22 | then 23 | password="`cat $pass`" 24 | 25 | if [ -z "$password" ] 26 | then 27 | REDIS_PASSWORD="$password" 28 | fi 29 | fi 30 | 31 | echo "$REDIS_PASSWORD" | egrep -qi "enable|true|random|yes" 32 | if [ $? = 0 ] 33 | then 34 | REDIS_PASSWORD="`cat /dev/urandom | sed 's/[^a-zA-Z0-9]//g' | strings -n 12 | head -1`" 35 | fi 36 | 37 | echo "$REDIS_PASSWORD" > $pass 38 | echo "requirepass \"$REDIS_PASSWORD\"" >> $conf 39 | 40 | fi 41 | if [ "$REDIS_CLUSTER" = "true" ] 42 | then 43 | echo "Enable Cluster" 44 | echo 'cluster-enabled yes' >> $conf 45 | fi 46 | 47 | # Start Redis Server 48 | redis-server $conf 49 | else 50 | "$@" 51 | fi -------------------------------------------------------------------------------- /redis/4.0.12/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/alpine:3.8 2 | 3 | LABEL Maintainer="Lin.Ru@msn.com" 4 | 5 | COPY run.sh / 6 | 7 | ENV REDIS_DIRS="/var/lib/redis /var/run/redis /var/log/redis" \ 8 | REDIS_CONF="/etc/redis.conf" 9 | 10 | RUN apk update && \ 11 | apk upgrade && \ 12 | apk add "redis~=4.0.12" && \ 13 | chmod -v 755 /run.sh && \ 14 | sed -i 's/^bind .*/bind 0.0.0.0/' $REDIS_CONF && \ 15 | sed -i 's/^daemonize .*/daemonize no/' $REDIS_CONF && \ 16 | chown 1000 $REDIS_DIRS 17 | 18 | COPY redis-sentinel.conf /etc 19 | 20 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /redis/4.0.12/redis-sentinel.conf: -------------------------------------------------------------------------------- 1 | sentinel monitor mymaster REDIS_MASTER_HOST REDIS_MASTER_PORT 2 2 | sentinel down-after-milliseconds mymaster 30000 3 | sentinel parallel-syncs mymaster 1 4 | sentinel failover-timeout mymaster 180000 -------------------------------------------------------------------------------- /redis/4.0.12/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | conf=/etc/redis.conf 14 | senc=/etc/redis-sentinel.conf 15 | pass=/var/lib/redis/password 16 | 17 | if [ ! -z "$REDIS_PASSWORD" ] 18 | then 19 | if [ -f $pass ] 20 | then 21 | password="`cat $pass`" 22 | 23 | test -z "$password" && REDIS_PASSWORD="$password" 24 | fi 25 | 26 | echo "$REDIS_PASSWORD" > $pass 27 | echo "requirepass \"$REDIS_PASSWORD\"" >> $conf 28 | 29 | fi 30 | 31 | if [ "$REDIS_CLUSTER" = "true" ] 32 | then 33 | ccf="cluster-config-file" 34 | ccp="/var/lib/redis/nodes.conf" 35 | echo 'cluster-enabled yes' >> $conf 36 | grep "^$ccf" -q $conf 37 | test $? = 0 && sed -i "s#$ccf.*#$ccf $ccp#" $conf || echo "$ccf $ccp" >> $conf 38 | fi 39 | 40 | test -z "$REDIS_MODE" && REDIS_MODE="master" 41 | test -z "$REDIS_MASTER_SVC_HOST" && REDIS_MASTER_SVC_HOST="redis-master" 42 | test -z "$REDIS_MASTER_SVC_PORT" && REDIS_MASTER_SVC_PORT=6379 43 | 44 | echo "Start Redis with `echo $REDIS_MODE | tr a-z A-Z`" 45 | 46 | case $REDIS_MODE in 47 | cluster) 48 | # TD 49 | ;; 50 | master) 51 | redis-server $conf 52 | ;; 53 | slave) 54 | echo "masterauth $REDIS_PASSWORD" >> $conf 55 | 56 | # See https://redis.io/topics/sentinel 57 | echo "slave-announce-ip `hostname -i`" >> $conf 58 | 59 | redis-server $conf --slaveof $REDIS_MASTER_SVC_HOST $REDIS_MASTER_SVC_PORT 60 | ;; 61 | sentinel) 62 | test ! -z "$REDIS_PASSWORD" && echo "sentinel auth-pass mymaster $REDIS_PASSWORD" >> $senc 63 | 64 | sed -i "s/REDIS_MASTER_HOST/$REDIS_MASTER_SVC_HOST/" $senc 65 | sed -i "s/REDIS_MASTER_PORT/$REDIS_MASTER_SVC_PORT/" $senc 66 | 67 | # See https://redis.io/topics/sentinel 68 | echo "sentinel announce-ip `hostname -i`" >> $senc 69 | 70 | redis-server $senc --sentinel --protected-mode no 71 | ;; 72 | esac 73 | else 74 | "$@" 75 | fi -------------------------------------------------------------------------------- /redis/4.0.6/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/alpine:3.7 10 | 11 | LABEL Maintainer="Lin.Ru@msn.com" 12 | 13 | COPY run.sh / 14 | 15 | RUN apk update && \ 16 | apk add "redis~=4.0.6" && \ 17 | chmod -v 755 /run.sh 18 | 19 | CMD ["/run.sh"] -------------------------------------------------------------------------------- /redis/4.0.6/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | config=/etc/redis.conf 14 | 15 | # Set bind address to '0.0.0.0' 16 | sed -i 's/^bind .*/bind 0.0.0.0/' $config 17 | 18 | # Set daemonize to 'no' 19 | sed -i 's/^daemonize .*/daemonize no/' $config 20 | 21 | # Start Redis Server 22 | redis-server $config 23 | else 24 | "$@" 25 | fi -------------------------------------------------------------------------------- /redis/5.0.7/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.11 2 | 3 | LABEL Maintainer="Lin.Ru@msn.com" 4 | 5 | 6 | COPY run.sh / 7 | COPY init-cluster.sh / 8 | 9 | ENV REDIS_DIRS="/var/lib/redis /var/run/redis /var/log/redis" \ 10 | REDIS_CONF="/etc/redis.conf" 11 | 12 | RUN apk update && \ 13 | apk upgrade && \ 14 | chmod -v 755 /run.sh init-cluster.sh && \ 15 | apk add "redis~=5.0.7" bash expect && \ 16 | sed -i 's/^bind .*/bind 0.0.0.0/' $REDIS_CONF && \ 17 | sed -i 's/^daemonize .*/daemonize no/' $REDIS_CONF && \ 18 | chown 1000 $REDIS_DIRS 19 | 20 | COPY redis-sentinel.conf /etc 21 | 22 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /redis/5.0.7/init-cluster.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | while true 4 | do 5 | ping $REDIS_NAME-5.$SUB_DOMAIN -c 2 > /dev/null 2>&1 6 | test $? = 0 && break 7 | sleep 5 8 | echo -e "`date +'%F %T'` Waiting for last redis is ready" 9 | done 10 | 11 | members="`for i in {0..5}; do echo -n $(ping $REDIS_NAME-$i.$SUB_DOMAIN -c 1 | head -1 | awk -F '[()]' '{print $2}'):6379' ' ; done`" 12 | 13 | expect <> $conf 54 | echo "requirepass \"$REDIS_PASSWORD\"" >> $conf 55 | fi 56 | 57 | echo "Start Redis with `echo $REDIS_MODE | tr a-z A-Z`" 58 | 59 | case $REDIS_MODE in 60 | cluster) 61 | ccp="/var/lib/redis/nodes.conf" 62 | echo "cluster-enabled yes" >> $conf 63 | echo "cluster-announce-ip $MYIP" >> $conf 64 | echo "cluster-config-file $ccp" >> $conf 65 | 66 | test -f $ccp && sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/$MYIP/" $ccp 67 | 68 | echo -e "My self is $MYIP" 69 | 70 | redis-server $conf 71 | ;; 72 | master) 73 | sentinelProcess 74 | redis-server $conf 75 | ;; 76 | slave) 77 | sentinelProcess 78 | echo "masterauth \"$REDIS_PASSWORD\"" >> $conf 79 | 80 | # See https://redis.io/topics/sentinel 81 | echo "slave-announce-ip $MYIP" >> $conf 82 | 83 | redis-server $conf --slaveof $REDIS_MASTER_SVC_HOST $REDIS_MASTER_SVC_PORT 84 | ;; 85 | sentinel) 86 | sentinelProcess 87 | test ! -z "$REDIS_PASSWORD" && \ 88 | echo "sentinel auth-pass $REDIS_CLUSTER_NAME \"$REDIS_PASSWORD\"" >> $senc 89 | 90 | sed -i "s/REDIS_MASTER_HOST/$REDIS_MASTER_SVC_HOST/" $senc 91 | sed -i "s/REDIS_MASTER_PORT/$REDIS_MASTER_SVC_PORT/" $senc 92 | 93 | # See https://redis.io/topics/sentinel 94 | echo "sentinel announce-ip `hostname -i`" >> $senc 95 | 96 | redis-server $senc --sentinel --protected-mode no 97 | ;; 98 | standard) 99 | redis-server $conf 100 | ;; 101 | esac 102 | else 103 | "$@" 104 | fi -------------------------------------------------------------------------------- /sonarqube/7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.03.22 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:8u151 10 | 11 | LABEL MAINTAINER="Lin Ru " 12 | 13 | COPY run.sh / 14 | 15 | RUN apk update && \ 16 | apk upgrade && \ 17 | n="sonarqube" && \ 18 | v="7.0" && \ 19 | curl -sLO https://sonarsource.bintray.com/Distribution/$n/$n-$v.zip && \ 20 | unzip -q $n-$v.zip && \ 21 | mv $n-$v $n && \ 22 | adduser sonar -D && \ 23 | chmod 755 /run.sh && \ 24 | apk add bash && \ 25 | rm -rf $n/extensions $n/data $n-$v.zip && \ 26 | chown -R sonar:sonar /$n 27 | 28 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /sonarqube/7.0/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.03.22 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | v="$S_VER" 14 | u="sonar" 15 | h="/$S_NAME" 16 | 17 | export SONAR_HOME="$h" 18 | 19 | s="/data/$S_NAME" 20 | e="$s/extensions" 21 | d="$s/data" 22 | c="$s/conf" 23 | 24 | test -d $e || mkdir -p $e 25 | test -d $d || mkdir -p $d 26 | 27 | test -d $h/extensions || ln -s $e $h/extensions 28 | test -d $h/data || ln -s $d $h/data 29 | test -d $c && rm -rf $h/conf && ln -s $c $h/conf 30 | 31 | chown -R $u:$u $s 32 | 33 | su - "$u" -c "java -jar $SONARQUBE_WEB_JVM_OPTS $h/lib/sonar-application-$v.jar \ 34 | -Dsonar.log.console=true \ 35 | -Dsonar.jdbc.username='$SONARQUBE_JDBC_USERNAME' \ 36 | -Dsonar.jdbc.password='$SONARQUBE_JDBC_PASSWORD' \ 37 | -Dsonar.jdbc.url='$SONARQUBE_JDBC_URL'" 38 | else 39 | "$@" 40 | fi 41 | -------------------------------------------------------------------------------- /sonarqube/7.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.03.22 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:8u151 10 | 11 | LABEL MAINTAINER="Lin Ru " 12 | 13 | COPY run.sh / 14 | 15 | RUN apk update && \ 16 | apk upgrade && \ 17 | n="sonarqube" && \ 18 | v="7.1" && \ 19 | curl -sLO https://sonarsource.bintray.com/Distribution/$n/$n-$v.zip && \ 20 | unzip -q $n-$v.zip && \ 21 | mv $n-$v $n && \ 22 | adduser sonar -D && \ 23 | chmod 755 /run.sh && \ 24 | apk add bash && \ 25 | rm -rf $n/extensions $n/data $n-$v.zip && \ 26 | chown -R sonar:sonar /$n 27 | 28 | ENTRYPOINT ["/run.sh"] -------------------------------------------------------------------------------- /sonarqube/7.1/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.03.22 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | v="$S_VER" 14 | u="sonar" 15 | h="/$S_NAME" 16 | 17 | export SONAR_HOME="$h" 18 | 19 | s="/data/$S_NAME" 20 | e="$s/extensions" 21 | d="$s/data" 22 | c="$s/conf" 23 | 24 | test -d $e || mkdir -p $e 25 | test -d $d || mkdir -p $d 26 | 27 | test -d $h/extensions || ln -s $e $h/extensions 28 | test -d $h/data || ln -s $d $h/data 29 | test -d $c && rm -rf $h/conf && ln -s $c $h/conf 30 | 31 | chown -R $u:$u $s 32 | 33 | su - "$u" -c "java -jar $SONARQUBE_WEB_JVM_OPTS $h/lib/sonar-application-$v.jar \ 34 | -Dsonar.log.console=true \ 35 | -Dsonar.jdbc.username='$SONARQUBE_JDBC_USERNAME' \ 36 | -Dsonar.jdbc.password='$SONARQUBE_JDBC_PASSWORD' \ 37 | -Dsonar.jdbc.url='$SONARQUBE_JDBC_URL'" 38 | else 39 | "$@" 40 | fi 41 | -------------------------------------------------------------------------------- /tensorflow/1.11.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/python:3.6.5-centos 2 | 3 | LABEL MAINTAINER="Lin.Ru@msn.com" 4 | 5 | RUN yum update -y && \ 6 | yum install -y vim git && \ 7 | m_ver="5.7.24" && \ 8 | m_pkg="common libs devel" && \ 9 | m_url="https://mirrors.tuna.tsinghua.edu.cn/mysql/yum/mysql57-community-el7" && \ 10 | aliyun="mirrors.aliyun.com" && \ 11 | pip_args="-i http://$aliyun/pypi/simple --trusted-host=$aliyun" && \ 12 | for i in $m_pkg; \ 13 | do rpm -ivh $m_url/mysql-community-$i-$m_ver-1.el7.x86_64.rpm; done && \ 14 | pip install $pip_args mysqlclient numpy pandas flask \ 15 | sklearn jieba cacheout tensorflow==1.11.0 keras -------------------------------------------------------------------------------- /zipkin/2.5.1/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:8u151 10 | 11 | ENV version=2.5.1 12 | LABEL MAINTAINER="Lin Ru " 13 | 14 | COPY run.sh / 15 | RUN apk upgrade && \ 16 | chmod 755 /run.sh && \ 17 | curl -sL "https://search.maven.org/remote_content?g=io.zipkin.java&a=zipkin-server&v=$version&c=exec" -o zipkin.jar 18 | 19 | ENTRYPOINT ["/run.sh"] 20 | -------------------------------------------------------------------------------- /zipkin/2.5.1/README.md: -------------------------------------------------------------------------------- 1 | # zipkin 2 | 3 | ## Build 4 | 5 | docker build statemood/zipkin:2.5.1 . 6 | 7 | ## Push 8 | 9 | docker push statemood/zipkin:2.5.1 10 | 11 | ## Pull 12 | 13 | docker pull statemood/zipkin:2.5.1 14 | -------------------------------------------------------------------------------- /zipkin/2.5.1/run.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # -------------------------------------------- 4 | # Created by Statemood, 2018.01.06 5 | # I.am.RuLin@gmail.com 6 | # 7 | # Project dockerfiles: 8 | # https://github.com/Statemood/dockerfiles 9 | # -------------------------------------------- 10 | 11 | if [ -z "$@" ] 12 | then 13 | zpk_args="STORAGE_TYPE=elasticsearch" 14 | zpk_args="$zpk_args ES_HOSTS=$ES_HOST:$ES_PORT" 15 | 16 | export $zpk_args 17 | java -jar $JAVA_OPTS /zipkin.jar 18 | else 19 | "$@" 20 | fi 21 | -------------------------------------------------------------------------------- /zookeeper/3.4.10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/jre:8u181 2 | 3 | RUN apk update && \ 4 | apk upgrade && \ 5 | apk add bash sudo && \ 6 | ZK=zookeeper && \ 7 | ZK_USER=$ZK && \ 8 | ZK_DATA_DIR=/var/lib/$ZK/data && \ 9 | ZK_DATA_LOG_DIR=/var/lib/$ZK/log && \ 10 | ZK_LOG_DIR=/var/log/$ZK && \ 11 | ZK_DIST=$ZK-3.4.10 && \ 12 | addgroup -g 567 $ZK_USER && \ 13 | adduser $ZK_USER -G $ZK_USER -D -u 567 && \ 14 | mkdir /opt && \ 15 | curl -Os "https://mirrors.aliyun.com/apache/$ZK/$ZK_DIST/$ZK_DIST.tar.gz" && \ 16 | tar xzf "$ZK_DIST.tar.gz" -C /opt && \ 17 | rm -r "$ZK_DIST.tar.gz" && \ 18 | ln -s /opt/$ZK_DIST /opt/$ZK && \ 19 | rm -rf /opt/$ZK/CHANGES.txt \ 20 | /opt/$ZK/README.txt \ 21 | /opt/$ZK/NOTICE.txt \ 22 | /opt/$ZK/CHANGES.txt \ 23 | /opt/$ZK/README_packaging.txt \ 24 | /opt/$ZK/bin/*.cmd \ 25 | /opt/$ZK/build.xml \ 26 | /opt/$ZK/config \ 27 | /opt/$ZK/contrib \ 28 | /opt/$ZK/dist-maven \ 29 | /opt/$ZK/docs \ 30 | /opt/$ZK/ivy.xml \ 31 | /opt/$ZK/ivysettings.xml \ 32 | /opt/$ZK/recipes \ 33 | /opt/$ZK/src \ 34 | /opt/$ZK/$ZK_DIST.jar.asc \ 35 | /opt/$ZK/$ZK_DIST.jar.md5 \ 36 | /opt/$ZK/$ZK_DIST.jar.sha1 && \ 37 | mkdir -p $ZK_DATA_DIR $ZK_DATA_LOG_DIR $ZK_LOG_DIR /usr/share/$ZK /tmp/$ZK /usr/etc/ && \ 38 | chown -R "$ZK_USER:$ZK_USER" /opt/$ZK/conf $ZK_DATA_DIR $ZK_LOG_DIR $ZK_DATA_LOG_DIR /tmp/$ZK && \ 39 | ln -s /opt/$ZK/conf/ /usr/etc/$ZK && \ 40 | ln -s /opt/$ZK/$ZK_DIST.jar /usr/share/$ZK/ && \ 41 | ln -s /opt/$ZK/lib/* /usr/share/$ZK 42 | 43 | # Copy configuration generator script to bin 44 | COPY zkGenConfig.sh zkOk.sh zkMetrics.sh /opt/zookeeper/bin/ 45 | COPY user-zookeeper-chown-dir /etc/sudoers.d/ 46 | COPY init-dir.sh / 47 | 48 | RUN ln -sv /opt/zookeeper/bin/*.sh /usr/bin && \ 49 | chmod 755 /opt/zookeeper/bin/*.sh /init-dir.sh -------------------------------------------------------------------------------- /zookeeper/3.4.10/init-dir.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | h=/var/lib/zookeeper 4 | d=$h/data 5 | test -d $d || mkdir -p $d 6 | test -d $h && chown -Rv 567:567 $h -------------------------------------------------------------------------------- /zookeeper/3.4.10/user-zookeeper-chown-dir: -------------------------------------------------------------------------------- 1 | Cmnd_Alias INITDATDDIR = /init-dir.sh 2 | 3 | zookeeper ALL=(ALL) NOPASSWD: INITDATDDIR -------------------------------------------------------------------------------- /zookeeper/3.4.10/zkGenConfig.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ZK_USER=${ZK_USER:-"zookeeper"} 17 | ZK_LOG_LEVEL=${ZK_LOG_LEVEL:-"INFO"} 18 | ZK_DATA_DIR=${ZK_DATA_DIR:-"/var/lib/zookeeper/data"} 19 | ZK_DATA_LOG_DIR=${ZK_DATA_LOG_DIR:-"/var/lib/zookeeper/log"} 20 | ZK_LOG_DIR=${ZK_LOG_DIR:-"var/log/zookeeper"} 21 | ZK_CONF_DIR=${ZK_CONF_DIR:-"/opt/zookeeper/conf"} 22 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 23 | ZK_SERVER_PORT=${ZK_SERVER_PORT:-2888} 24 | ZK_ELECTION_PORT=${ZK_ELECTION_PORT:-3888} 25 | ZK_TICK_TIME=${ZK_TICK_TIME:-2000} 26 | ZK_INIT_LIMIT=${ZK_INIT_LIMIT:-10} 27 | ZK_SYNC_LIMIT=${ZK_SYNC_LIMIT:-5} 28 | ZK_HEAP_SIZE=${ZK_HEAP_SIZE:-2G} 29 | ZK_MAX_CLIENT_CNXNS=${ZK_MAX_CLIENT_CNXNS:-60} 30 | ZK_MIN_SESSION_TIMEOUT=${ZK_MIN_SESSION_TIMEOUT:- $((ZK_TICK_TIME*2))} 31 | ZK_MAX_SESSION_TIMEOUT=${ZK_MAX_SESSION_TIMEOUT:- $((ZK_TICK_TIME*20))} 32 | ZK_SNAP_RETAIN_COUNT=${ZK_SNAP_RETAIN_COUNT:-3} 33 | ZK_PURGE_INTERVAL=${ZK_PURGE_INTERVAL:-0} 34 | ID_FILE="$ZK_DATA_DIR/myid" 35 | ZK_CONFIG_FILE="$ZK_CONF_DIR/zoo.cfg" 36 | LOGGER_PROPS_FILE="$ZK_CONF_DIR/log4j.properties" 37 | JAVA_ENV_FILE="$ZK_CONF_DIR/java.env" 38 | HOST=`hostname -s` 39 | DOMAIN=`hostname -d` 40 | 41 | function print_servers() { 42 | for (( i=1; i<=$ZK_REPLICAS; i++ )) 43 | do 44 | echo "server.$i=$NAME-$((i-1)).$DOMAIN:$ZK_SERVER_PORT:$ZK_ELECTION_PORT" 45 | done 46 | } 47 | 48 | function validate_env() { 49 | echo "Validating environment" 50 | 51 | if [ -z $ZK_REPLICAS ]; then 52 | echo "ZK_REPLICAS is a mandatory environment variable" 53 | exit 1 54 | fi 55 | 56 | if [[ $HOST =~ (.*)-([0-9]+)$ ]]; then 57 | NAME=${BASH_REMATCH[1]} 58 | ORD=${BASH_REMATCH[2]} 59 | else 60 | echo "Failed to extract ordinal from hostname $HOST" 61 | exit 1 62 | fi 63 | 64 | MY_ID=$((ORD+1)) 65 | echo "ZK_REPLICAS=$ZK_REPLICAS" 66 | echo "MY_ID=$MY_ID" 67 | echo "ZK_LOG_LEVEL=$ZK_LOG_LEVEL" 68 | echo "ZK_DATA_DIR=$ZK_DATA_DIR" 69 | echo "ZK_DATA_LOG_DIR=$ZK_DATA_LOG_DIR" 70 | echo "ZK_LOG_DIR=$ZK_LOG_DIR" 71 | echo "ZK_CLIENT_PORT=$ZK_CLIENT_PORT" 72 | echo "ZK_SERVER_PORT=$ZK_SERVER_PORT" 73 | echo "ZK_ELECTION_PORT=$ZK_ELECTION_PORT" 74 | echo "ZK_TICK_TIME=$ZK_TICK_TIME" 75 | echo "ZK_INIT_LIMIT=$ZK_INIT_LIMIT" 76 | echo "ZK_SYNC_LIMIT=$ZK_SYNC_LIMIT" 77 | echo "ZK_MAX_CLIENT_CNXNS=$ZK_MAX_CLIENT_CNXNS" 78 | echo "ZK_MIN_SESSION_TIMEOUT=$ZK_MIN_SESSION_TIMEOUT" 79 | echo "ZK_MAX_SESSION_TIMEOUT=$ZK_MAX_SESSION_TIMEOUT" 80 | echo "ZK_HEAP_SIZE=$ZK_HEAP_SIZE" 81 | echo "ZK_SNAP_RETAIN_COUNT=$ZK_SNAP_RETAIN_COUNT" 82 | echo "ZK_PURGE_INTERVAL=$ZK_PURGE_INTERVAL" 83 | echo "ENSEMBLE" 84 | print_servers 85 | echo "Environment validation successful" 86 | } 87 | 88 | function create_config() { 89 | rm -f $ZK_CONFIG_FILE 90 | echo "Creating ZooKeeper configuration" 91 | echo "#This file was autogenerated by k8szk DO NOT EDIT" >> $ZK_CONFIG_FILE 92 | echo "clientPort=$ZK_CLIENT_PORT" >> $ZK_CONFIG_FILE 93 | echo "dataDir=$ZK_DATA_DIR" >> $ZK_CONFIG_FILE 94 | echo "dataLogDir=$ZK_DATA_LOG_DIR" >> $ZK_CONFIG_FILE 95 | echo "tickTime=$ZK_TICK_TIME" >> $ZK_CONFIG_FILE 96 | echo "initLimit=$ZK_INIT_LIMIT" >> $ZK_CONFIG_FILE 97 | echo "syncLimit=$ZK_SYNC_LIMIT" >> $ZK_CONFIG_FILE 98 | echo "maxClientCnxns=$ZK_MAX_CLIENT_CNXNS" >> $ZK_CONFIG_FILE 99 | echo "minSessionTimeout=$ZK_MIN_SESSION_TIMEOUT" >> $ZK_CONFIG_FILE 100 | echo "maxSessionTimeout=$ZK_MAX_SESSION_TIMEOUT" >> $ZK_CONFIG_FILE 101 | echo "autopurge.snapRetainCount=$ZK_SNAP_RETAIN_COUNT" >> $ZK_CONFIG_FILE 102 | echo "autopurge.purgeInteval=$ZK_PURGE_INTERVAL" >> $ZK_CONFIG_FILE 103 | 104 | if [ $ZK_REPLICAS -gt 1 ]; then 105 | print_servers >> $ZK_CONFIG_FILE 106 | fi 107 | 108 | echo "Wrote ZooKeeper configuration file to $ZK_CONFIG_FILE" 109 | } 110 | 111 | function create_data_dirs() { 112 | echo "Creating ZooKeeper data directories and setting permissions" 113 | 114 | if [ ! -d $ZK_DATA_DIR ]; then 115 | mkdir -p $ZK_DATA_DIR 116 | chown -R $ZK_USER:$ZK_USER $ZK_DATA_DIR 117 | fi 118 | 119 | if [ ! -d $ZK_DATA_LOG_DIR ]; then 120 | mkdir -p $ZK_DATA_LOG_DIR 121 | chown -R $ZK_USER:$ZK_USER $ZK_DATA_LOG_DIR 122 | fi 123 | 124 | if [ ! -d $ZK_LOG_DIR ]; then 125 | mkdir -p $ZK_LOG_DIR 126 | chown -R $ZK_USER:$ZK_USER $ZK_LOG_DIR 127 | fi 128 | 129 | if [ ! -f $ID_FILE ]; then 130 | echo $MY_ID >> $ID_FILE 131 | fi 132 | 133 | echo "Created ZooKeeper data directories and set permissions in $ZK_DATA_DIR" 134 | } 135 | 136 | function create_log_props () { 137 | rm -f $LOGGER_PROPS_FILE 138 | echo "Creating ZooKeeper log4j configuration" 139 | echo "zookeeper.root.logger=CONSOLE" >> $LOGGER_PROPS_FILE 140 | echo "zookeeper.console.threshold="$ZK_LOG_LEVEL >> $LOGGER_PROPS_FILE 141 | echo "log4j.rootLogger=\${zookeeper.root.logger}" >> $LOGGER_PROPS_FILE 142 | echo "log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender" >> $LOGGER_PROPS_FILE 143 | echo "log4j.appender.CONSOLE.Threshold=\${zookeeper.console.threshold}" >> $LOGGER_PROPS_FILE 144 | echo "log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout" >> $LOGGER_PROPS_FILE 145 | echo "log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n" >> $LOGGER_PROPS_FILE 146 | echo "Wrote log4j configuration to $LOGGER_PROPS_FILE" 147 | } 148 | 149 | function create_java_env() { 150 | rm -f $JAVA_ENV_FILE 151 | echo "Creating JVM configuration file" 152 | echo "ZOO_LOG_DIR=$ZK_LOG_DIR" >> $JAVA_ENV_FILE 153 | echo "JVMFLAGS=\"-Xmx$ZK_HEAP_SIZE -Xms$ZK_HEAP_SIZE\"" >> $JAVA_ENV_FILE 154 | echo "Wrote JVM configuration to $JAVA_ENV_FILE" 155 | } 156 | 157 | validate_env && create_config && create_log_props && create_data_dirs && create_java_env -------------------------------------------------------------------------------- /zookeeper/3.4.10/zkMetrics.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 18 | echo mntr | nc localhost $ZK_CLIENT_PORT >& 1 -------------------------------------------------------------------------------- /zookeeper/3.4.10/zkOk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # zkOk.sh uses the ruok ZooKeeper four letter work to determine if the instance 17 | # is health. The $? variable will be set to 0 if server responds that it is 18 | # healthy, or 1 if the server fails to respond. 19 | 20 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 21 | OK=$(echo ruok | nc 127.0.0.1 $ZK_CLIENT_PORT) 22 | if [ "$OK" == "imok" ]; then 23 | exit 0 24 | else 25 | exit 1 26 | fi -------------------------------------------------------------------------------- /zookeeper/3.4.13/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM statemood/jre:8u181 2 | 3 | RUN apk update && \ 4 | apk upgrade && \ 5 | apk add bash sudo && \ 6 | ZK=zookeeper && \ 7 | ZK_USER=$ZK && \ 8 | ZK_DATA_DIR=/var/lib/$ZK/data && \ 9 | ZK_DATA_LOG_DIR=/var/lib/$ZK/log && \ 10 | ZK_LOG_DIR=/var/log/$ZK && \ 11 | ZK_DIST=$ZK-3.4.13 && \ 12 | addgroup -g 567 $ZK_USER && \ 13 | adduser $ZK_USER -G $ZK_USER -D -u 567 && \ 14 | mkdir /opt && \ 15 | curl -Os "https://mirrors.aliyun.com/apache/$ZK/$ZK_DIST/$ZK_DIST.tar.gz" && \ 16 | tar xzf "$ZK_DIST.tar.gz" -C /opt && \ 17 | rm -r "$ZK_DIST.tar.gz" && \ 18 | ln -s /opt/$ZK_DIST /opt/$ZK && \ 19 | rm -rf /opt/$ZK/CHANGES.txt \ 20 | /opt/$ZK/README.txt \ 21 | /opt/$ZK/NOTICE.txt \ 22 | /opt/$ZK/CHANGES.txt \ 23 | /opt/$ZK/README_packaging.txt \ 24 | /opt/$ZK/bin/*.cmd \ 25 | /opt/$ZK/build.xml \ 26 | /opt/$ZK/config \ 27 | /opt/$ZK/contrib \ 28 | /opt/$ZK/dist-maven \ 29 | /opt/$ZK/docs \ 30 | /opt/$ZK/ivy.xml \ 31 | /opt/$ZK/ivysettings.xml \ 32 | /opt/$ZK/recipes \ 33 | /opt/$ZK/src \ 34 | /opt/$ZK/$ZK_DIST.jar.asc \ 35 | /opt/$ZK/$ZK_DIST.jar.md5 \ 36 | /opt/$ZK/$ZK_DIST.jar.sha1 && \ 37 | mkdir -p $ZK_DATA_DIR $ZK_DATA_LOG_DIR $ZK_LOG_DIR /usr/share/$ZK /tmp/$ZK /usr/etc/ && \ 38 | chown -R "$ZK_USER:$ZK_USER" /opt/$ZK/conf $ZK_DATA_DIR $ZK_LOG_DIR $ZK_DATA_LOG_DIR /tmp/$ZK && \ 39 | ln -s /opt/$ZK/conf/ /usr/etc/$ZK && \ 40 | ln -s /opt/$ZK/$ZK_DIST.jar /usr/share/$ZK/ && \ 41 | ln -s /opt/$ZK/lib/* /usr/share/$ZK 42 | 43 | # Copy configuration generator script to bin 44 | COPY zkGenConfig.sh zkOk.sh zkMetrics.sh /opt/zookeeper/bin/ 45 | COPY user-zookeeper-chown-dir /etc/sudoers.d/ 46 | COPY init-dir.sh / 47 | 48 | RUN ln -sv /opt/zookeeper/bin/*.sh /usr/bin && \ 49 | chmod 755 /opt/zookeeper/bin/*.sh /init-dir.sh -------------------------------------------------------------------------------- /zookeeper/3.4.13/init-dir.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | h=/var/lib/zookeeper 4 | d=$h/data 5 | test -d $d || mkdir -p $d 6 | test -d $h && chown -Rv 567:567 $h -------------------------------------------------------------------------------- /zookeeper/3.4.13/user-zookeeper-chown-dir: -------------------------------------------------------------------------------- 1 | Cmnd_Alias INITDATDDIR = /init-dir.sh 2 | 3 | zookeeper ALL=(ALL) NOPASSWD: INITDATDDIR -------------------------------------------------------------------------------- /zookeeper/3.4.13/zkGenConfig.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ZK_USER=${ZK_USER:-"zookeeper"} 17 | ZK_LOG_LEVEL=${ZK_LOG_LEVEL:-"INFO"} 18 | ZK_DATA_DIR=${ZK_DATA_DIR:-"/var/lib/zookeeper/data"} 19 | ZK_DATA_LOG_DIR=${ZK_DATA_LOG_DIR:-"/var/lib/zookeeper/log"} 20 | ZK_LOG_DIR=${ZK_LOG_DIR:-"var/log/zookeeper"} 21 | ZK_CONF_DIR=${ZK_CONF_DIR:-"/opt/zookeeper/conf"} 22 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 23 | ZK_SERVER_PORT=${ZK_SERVER_PORT:-2888} 24 | ZK_ELECTION_PORT=${ZK_ELECTION_PORT:-3888} 25 | ZK_TICK_TIME=${ZK_TICK_TIME:-2000} 26 | ZK_INIT_LIMIT=${ZK_INIT_LIMIT:-10} 27 | ZK_SYNC_LIMIT=${ZK_SYNC_LIMIT:-5} 28 | ZK_HEAP_SIZE=${ZK_HEAP_SIZE:-2G} 29 | ZK_MAX_CLIENT_CNXNS=${ZK_MAX_CLIENT_CNXNS:-60} 30 | ZK_MIN_SESSION_TIMEOUT=${ZK_MIN_SESSION_TIMEOUT:- $((ZK_TICK_TIME*2))} 31 | ZK_MAX_SESSION_TIMEOUT=${ZK_MAX_SESSION_TIMEOUT:- $((ZK_TICK_TIME*20))} 32 | ZK_SNAP_RETAIN_COUNT=${ZK_SNAP_RETAIN_COUNT:-3} 33 | ZK_PURGE_INTERVAL=${ZK_PURGE_INTERVAL:-0} 34 | ID_FILE="$ZK_DATA_DIR/myid" 35 | ZK_CONFIG_FILE="$ZK_CONF_DIR/zoo.cfg" 36 | LOGGER_PROPS_FILE="$ZK_CONF_DIR/log4j.properties" 37 | JAVA_ENV_FILE="$ZK_CONF_DIR/java.env" 38 | HOST=`hostname -s` 39 | 40 | test -z "$ZK_DOMAIN" && DOMAIN=`hostname -d` || DOMAIN=$ZK_DOMAIN 41 | 42 | function print_servers() { 43 | for (( i=1; i<=$ZK_REPLICAS; i++ )) 44 | do 45 | echo "server.$i=$NAME-$((i-1)).$DOMAIN:$ZK_SERVER_PORT:$ZK_ELECTION_PORT" 46 | done 47 | } 48 | 49 | function validate_env() { 50 | echo "Validating environment" 51 | 52 | if [ -z $ZK_REPLICAS ]; then 53 | echo "ZK_REPLICAS is a mandatory environment variable" 54 | exit 1 55 | fi 56 | 57 | if [[ $HOST =~ (.*)-([0-9]+)$ ]]; then 58 | NAME=${BASH_REMATCH[1]} 59 | ORD=${BASH_REMATCH[2]} 60 | else 61 | echo "Failed to extract ordinal from hostname $HOST" 62 | exit 1 63 | fi 64 | 65 | MY_ID=$((ORD+1)) 66 | echo "ZK_REPLICAS=$ZK_REPLICAS" 67 | echo "MY_ID=$MY_ID" 68 | echo "ZK_LOG_LEVEL=$ZK_LOG_LEVEL" 69 | echo "ZK_DATA_DIR=$ZK_DATA_DIR" 70 | echo "ZK_DATA_LOG_DIR=$ZK_DATA_LOG_DIR" 71 | echo "ZK_LOG_DIR=$ZK_LOG_DIR" 72 | echo "ZK_CLIENT_PORT=$ZK_CLIENT_PORT" 73 | echo "ZK_SERVER_PORT=$ZK_SERVER_PORT" 74 | echo "ZK_ELECTION_PORT=$ZK_ELECTION_PORT" 75 | echo "ZK_TICK_TIME=$ZK_TICK_TIME" 76 | echo "ZK_INIT_LIMIT=$ZK_INIT_LIMIT" 77 | echo "ZK_SYNC_LIMIT=$ZK_SYNC_LIMIT" 78 | echo "ZK_MAX_CLIENT_CNXNS=$ZK_MAX_CLIENT_CNXNS" 79 | echo "ZK_MIN_SESSION_TIMEOUT=$ZK_MIN_SESSION_TIMEOUT" 80 | echo "ZK_MAX_SESSION_TIMEOUT=$ZK_MAX_SESSION_TIMEOUT" 81 | echo "ZK_HEAP_SIZE=$ZK_HEAP_SIZE" 82 | echo "ZK_SNAP_RETAIN_COUNT=$ZK_SNAP_RETAIN_COUNT" 83 | echo "ZK_PURGE_INTERVAL=$ZK_PURGE_INTERVAL" 84 | echo "ENSEMBLE" 85 | print_servers 86 | echo "Environment validation successful" 87 | } 88 | 89 | function create_config() { 90 | rm -f $ZK_CONFIG_FILE 91 | echo "Creating ZooKeeper configuration" 92 | echo "#This file was autogenerated by k8szk DO NOT EDIT" >> $ZK_CONFIG_FILE 93 | echo "clientPort=$ZK_CLIENT_PORT" >> $ZK_CONFIG_FILE 94 | echo "dataDir=$ZK_DATA_DIR" >> $ZK_CONFIG_FILE 95 | echo "dataLogDir=$ZK_DATA_LOG_DIR" >> $ZK_CONFIG_FILE 96 | echo "tickTime=$ZK_TICK_TIME" >> $ZK_CONFIG_FILE 97 | echo "initLimit=$ZK_INIT_LIMIT" >> $ZK_CONFIG_FILE 98 | echo "syncLimit=$ZK_SYNC_LIMIT" >> $ZK_CONFIG_FILE 99 | echo "maxClientCnxns=$ZK_MAX_CLIENT_CNXNS" >> $ZK_CONFIG_FILE 100 | echo "minSessionTimeout=$ZK_MIN_SESSION_TIMEOUT" >> $ZK_CONFIG_FILE 101 | echo "maxSessionTimeout=$ZK_MAX_SESSION_TIMEOUT" >> $ZK_CONFIG_FILE 102 | echo "autopurge.snapRetainCount=$ZK_SNAP_RETAIN_COUNT" >> $ZK_CONFIG_FILE 103 | echo "autopurge.purgeInteval=$ZK_PURGE_INTERVAL" >> $ZK_CONFIG_FILE 104 | 105 | if [ $ZK_REPLICAS -gt 1 ]; then 106 | print_servers >> $ZK_CONFIG_FILE 107 | fi 108 | 109 | echo "Wrote ZooKeeper configuration file to $ZK_CONFIG_FILE" 110 | } 111 | 112 | function create_data_dirs() { 113 | echo "Creating ZooKeeper data directories and setting permissions" 114 | 115 | if [ ! -d $ZK_DATA_DIR ]; then 116 | mkdir -p $ZK_DATA_DIR 117 | chown -R $ZK_USER:$ZK_USER $ZK_DATA_DIR 118 | fi 119 | 120 | if [ ! -d $ZK_DATA_LOG_DIR ]; then 121 | mkdir -p $ZK_DATA_LOG_DIR 122 | chown -R $ZK_USER:$ZK_USER $ZK_DATA_LOG_DIR 123 | fi 124 | 125 | if [ ! -d $ZK_LOG_DIR ]; then 126 | mkdir -p $ZK_LOG_DIR 127 | chown -R $ZK_USER:$ZK_USER $ZK_LOG_DIR 128 | fi 129 | 130 | if [ ! -f $ID_FILE ]; then 131 | echo $MY_ID >> $ID_FILE 132 | fi 133 | 134 | echo "Created ZooKeeper data directories and set permissions in $ZK_DATA_DIR" 135 | } 136 | 137 | function create_log_props () { 138 | rm -f $LOGGER_PROPS_FILE 139 | echo "Creating ZooKeeper log4j configuration" 140 | echo "zookeeper.root.logger=CONSOLE" >> $LOGGER_PROPS_FILE 141 | echo "zookeeper.console.threshold="$ZK_LOG_LEVEL >> $LOGGER_PROPS_FILE 142 | echo "log4j.rootLogger=\${zookeeper.root.logger}" >> $LOGGER_PROPS_FILE 143 | echo "log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender" >> $LOGGER_PROPS_FILE 144 | echo "log4j.appender.CONSOLE.Threshold=\${zookeeper.console.threshold}" >> $LOGGER_PROPS_FILE 145 | echo "log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout" >> $LOGGER_PROPS_FILE 146 | echo "log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} [myid:%X{myid}] - %-5p [%t:%C{1}@%L] - %m%n" >> $LOGGER_PROPS_FILE 147 | echo "Wrote log4j configuration to $LOGGER_PROPS_FILE" 148 | } 149 | 150 | function create_java_env() { 151 | rm -f $JAVA_ENV_FILE 152 | echo "Creating JVM configuration file" 153 | echo "ZOO_LOG_DIR=$ZK_LOG_DIR" >> $JAVA_ENV_FILE 154 | echo "JVMFLAGS=\"-Xmx$ZK_HEAP_SIZE -Xms$ZK_HEAP_SIZE\"" >> $JAVA_ENV_FILE 155 | echo "Wrote JVM configuration to $JAVA_ENV_FILE" 156 | } 157 | 158 | validate_env && create_config && create_log_props && create_data_dirs && create_java_env -------------------------------------------------------------------------------- /zookeeper/3.4.13/zkMetrics.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 18 | echo mntr | nc localhost $ZK_CLIENT_PORT >& 1 -------------------------------------------------------------------------------- /zookeeper/3.4.13/zkOk.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # zkOk.sh uses the ruok ZooKeeper four letter work to determine if the instance 17 | # is health. The $? variable will be set to 0 if server responds that it is 18 | # healthy, or 1 if the server fails to respond. 19 | 20 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 21 | OK=$(echo ruok | nc 127.0.0.1 $ZK_CLIENT_PORT) 22 | if [ "$OK" == "imok" ]; then 23 | exit 0 24 | else 25 | exit 1 26 | fi -------------------------------------------------------------------------------- /zookeeper/3.6.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # -------------------------------------------- 2 | # Created by Statemood, 2018.01.06 3 | # I.am.RuLin@gmail.com 4 | # 5 | # Project dockerfiles: 6 | # https://github.com/Statemood/dockerfiles 7 | # -------------------------------------------- 8 | 9 | FROM statemood/jre:1105 10 | 11 | RUN apk update && \ 12 | apk upgrade && \ 13 | ZK=zookeeper && \ 14 | ZK_USER=$ZK && \ 15 | ZK_DIST=$ZK-3.6.0 && \ 16 | zk_file=apache-$ZK_DIST-bin.tar.gz && \ 17 | addgroup -g 567 $ZK_USER && \ 18 | adduser $ZK_USER -G $ZK_USER -D -u 567 && \ 19 | apk add bash && \ 20 | curl -Os "https://mirrors.aliyun.com/apache/$ZK/$ZK_DIST/$zk_file" && \ 21 | tar xzf $zk_file -C /opt && \ 22 | rm -r "$zk_file" && \ 23 | ln -s /opt/${zk_file%.tar*} /opt/$ZK && \ 24 | chown -R 567 /opt/$ZK/conf && \ 25 | rm -rf /opt/$ZK/CHANGES.txt \ 26 | /opt/$ZK/README.txt \ 27 | /opt/$ZK/NOTICE.txt \ 28 | /opt/$ZK/CHANGES.txt \ 29 | /opt/$ZK/README_packaging.txt \ 30 | /opt/$ZK/bin/*.cmd \ 31 | /opt/$ZK/build.xml \ 32 | /opt/$ZK/config \ 33 | /opt/$ZK/contrib \ 34 | /opt/$ZK/dist-maven \ 35 | /opt/$ZK/docs \ 36 | /opt/$ZK/ivy.xml \ 37 | /opt/$ZK/ivysettings.xml \ 38 | /opt/$ZK/recipes \ 39 | /opt/$ZK/src \ 40 | /opt/$ZK/$ZK_DIST.jar.* 41 | 42 | # Copy configuration generator script to bin 43 | COPY zkOk.sh zkMetrics.sh /opt/zookeeper/bin/ 44 | COPY run.sh / 45 | 46 | RUN ln -sv /opt/zookeeper/bin/*.sh /usr/bin && \ 47 | ln -sv /tmp /opt/zookeeper/logs && \ 48 | chmod 755 /opt/zookeeper/bin/*.sh /run.sh 49 | 50 | CMD ["/run.sh"] -------------------------------------------------------------------------------- /zookeeper/3.6.0/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | z=/opt/zookeeper 6 | 7 | test -z "$ZK_CONF_DIR" && ZK_CONF_DIR=$z/conf 8 | test -z "$ZK_DATA_DIR" && ZK_DATA_DIR=/data/zk 9 | test -z "$ZK_REPLICAS" && ZK_REPLICAS=3 10 | 11 | # Generate the config only if it doesn't exist 12 | if [ ! -f $ZK_CONF_DIR/zoo.cfg ] 13 | then 14 | conf=$ZK_CONF_DIR/zoo.cfg 15 | echo "Generate ZK config" 16 | { 17 | echo "dataDir=${ZK_DATA_DIR}" 18 | 19 | echo "tickTime=${ZK_TICK_TIME:-2000}" 20 | echo "initLimit=${ZK_INIT_LIMIT:-10}" 21 | echo "syncLimit=${ZK_SYNC_LIMIT:-5}" 22 | 23 | echo "autopurge.snapRetainCount=${ZK_SNAP_RETAIN_COUNT:-7}" 24 | echo "autopurge.purgeInterval=${ZK_PURGE_INTERVAL:-24}" 25 | echo "maxClientCnxns=${ZK_MAX_CLIENT_CNXNS:-20}" 26 | echo "reconfigEnabled=true" 27 | echo "standaloneEnabled=${ZK_STANDALONE_ENABLED:-false}" 28 | echo "admin.enableServer=${ZK_ADMINSERVER_ENABLED:-true}" 29 | echo "4lw.commands.whitelist=${ZK_4LW_COMMANDS_WHITELIST:-'ruok'}" 30 | } >> $conf 31 | 32 | count=0 33 | total=$ZK_REPLICAS 34 | 35 | let total-- 36 | 37 | while true 38 | do 39 | s="server.$count=zk-$count.`hostname -d`:2888:3888;2181" 40 | echo "$s" >> $conf 41 | echo "$s" 42 | test $count = $total && break 43 | echo $((count++)) > /dev/null 44 | done 45 | fi 46 | 47 | # Write myid only if it doesn't exist 48 | echo "${HOSTNAME##*-}" > $ZK_DATA_DIR/myid 49 | 50 | echo '- - - - - - -= Zookeeper Configuration =- - - - - - -' 51 | echo -e "myid: `cat $ZK_DATA_DIR/myid`\n" 52 | cat $conf 53 | echo '- - - - - - -= Zookeeper Configuration =- - - - - - -' 54 | 55 | test -z "$@" && exec $z/bin/zkServer.sh start-foreground || exec "$@" -------------------------------------------------------------------------------- /zookeeper/3.6.0/zkMetrics.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 18 | echo mntr | nc localhost $ZK_CLIENT_PORT >& 1 -------------------------------------------------------------------------------- /zookeeper/3.6.0/zkOk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2016 The Kubernetes Authors. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # zkOk.sh uses the ruok ZooKeeper four letter work to determine if the instance 17 | # is health. The $? variable will be set to 0 if server responds that it is 18 | # healthy, or 1 if the server fails to respond. 19 | 20 | ZK_CLIENT_PORT=${ZK_CLIENT_PORT:-2181} 21 | OK=$(echo ruok | nc 127.0.0.1 $ZK_CLIENT_PORT) 22 | 23 | test "$OK" == "imok" && exit 0 || exit 1 --------------------------------------------------------------------------------