├── centos-base ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md ├── etc │ └── sudoers └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-cops ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── etc │ └── config_local.php └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-couchbase-ce ├── Dockerfile ├── Makefile └── scripts │ └── couchbase-start ├── centos-golang ├── Dockerfile └── LICENSE.txt ├── centos-haproxy ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-jenkins ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── etc │ └── jenkins └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-nginx ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md ├── etc │ └── nginx.repo └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-nlp4l ├── Dockerfile └── README.md ├── centos-nsq ├── Dockerfile ├── LICENSE.txt ├── Makefile └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-percona ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md ├── etc │ ├── my.cnf │ └── percona.init.sh └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-phabricator ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-php ├── Dockerfile ├── LICENSE.txt ├── Makefile ├── README.md ├── etc │ ├── fastcgi_params.conf │ └── www.conf └── scripts │ └── start.sh ├── centos-predictionio ├── Dockerfile └── README.md ├── centos-sonarqube ├── Dockerfile ├── Makefile └── scripts │ ├── first_run.sh │ ├── normal_run.sh │ └── start.sh ├── centos-spark ├── Dockerfile ├── Makefile ├── README.md ├── scripts │ ├── remove_alias.sh │ ├── spark-defaults.conf │ ├── spark-shell.sh │ ├── start-master.sh │ └── start-worker ├── spark-shell.sh ├── start-master.sh └── start-worker.sh └── centos-zeppelin ├── Dockerfile ├── Makefile ├── README.md └── scripts ├── build.sh ├── first_run.sh └── start.sh /centos-base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:centos7 2 | MAINTAINER Intern Avenue Dev Team 3 | 4 | # Create and configure Vagrant user 5 | RUN useradd --create-home -G wheel -s/bin/bash vagrant 6 | WORKDIR /home/vagrant 7 | 8 | # Install EPEL repo. 9 | RUN \ 10 | yum -y install \ 11 | http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm \ 12 | https://yum.puppetlabs.com/el/7/PC1/x86_64/puppetlabs-release-pc1-0.9.2-1.el7.noarch.rpm && \ 13 | yum -y upgrade 14 | 15 | # Install base stuff. 16 | RUN yum -y install \ 17 | bash-completion \ 18 | curl \ 19 | hostname \ 20 | initscripts \ 21 | openssh-clients \ 22 | openssh-server \ 23 | puppet-agent \ 24 | vim-enhanced \ 25 | tmux \ 26 | sudo \ 27 | syslog-ng \ 28 | syslog-ng-libdbi \ 29 | yum-plugin-fastestmirror 30 | 31 | # Clean up YUM when done. 32 | RUN yum clean all 33 | 34 | # Configure SSH access for Vagrant 35 | RUN mkdir -p /home/vagrant/.ssh && \ 36 | echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > /home/vagrant/.ssh/authorized_keys && \ 37 | chown -R vagrant: /home/vagrant/.ssh && \ 38 | chmod 600 /home/vagrant/.ssh/authorized_keys && \ 39 | echo -n 'vagrant:vagrant' | chpasswd 40 | 41 | # Enable passwordless sudo for users under the "sudo" group 42 | #RUN sed -i.bkp -e \ 43 | # 's/%wheel\s\+ALL=(ALL\(:ALL\)\?)\s\+ALL/%wheel ALL=NOPASSWD:ALL/g' \ 44 | # /etc/sudoers 45 | 46 | EXPOSE 22 47 | 48 | RUN mkdir /vagrant 49 | ADD etc/sudoers /etc/sudoers 50 | RUN chmod 440 /etc/sudoers 51 | 52 | ADD scripts /scripts 53 | RUN chmod +x /scripts/start.sh 54 | RUN touch /first_run 55 | RUN echo "UseDNS no" >> /etc/ssh/sshd_config 56 | RUN sed -i 's/UsePrivilegeSeparation sandbox/UsePrivilegeSeparation no/' /etc/ssh/sshd_config 57 | 58 | # Change the root password. The password should be changed and/or managed via Puppet. 59 | RUN echo 'root:Ch4ng3M3' | chpasswd 60 | 61 | # Expose our web root and log directories log. 62 | VOLUME ["/vagrant", "/var/log", "/run"] 63 | 64 | # Kicking in 65 | CMD ["/scripts/start.sh"] 66 | -------------------------------------------------------------------------------- /centos-base/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /centos-base/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-base 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-app1 7 | LOG_DIR:=/srv/docker/lon-dev-app1/log 8 | VAGRANT_DIR:=/srv/docker/lon-dev-app1/vagrant 9 | 10 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 11 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 12 | DOCKER_RUN_COMMON=--privileged=true --name="$(CONTAINER_NAME)" -P -v $(LOG_DIR):/var/log -v $(VAGRANT_DIR):/vagrant $(DOCKER_USER)/$(DOCKER_REPO_NAME) 13 | 14 | all: build 15 | 16 | build: 17 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 18 | 19 | run: clean 20 | mkdir -p $(LOG_DIR) 21 | docker run -d $(DOCKER_RUN_COMMON) 22 | 23 | bash: clean 24 | mkdir -p $(LOG_DIR) 25 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 26 | 27 | # Removes existing containers. 28 | clean: 29 | ifneq ($(strip $(RUNNING)),) 30 | docker stop $(RUNNING) 31 | endif 32 | ifneq ($(strip $(ALL)),) 33 | docker rm $(ALL) 34 | endif 35 | 36 | # Destroys the data directory. 37 | deepclean: clean 38 | sudo rm -rf $(LOG_DIR) 39 | -------------------------------------------------------------------------------- /centos-base/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-base 2 | 3 | A Dockerfile that produces a Vagrant-ready, CentOS-based Docker base image. 4 | 5 | ## Included packages (and their dependencies) 6 | 7 | * Midnight Commander 8 | * OpenSSH client and server 9 | * PWgen 10 | * Puppet 11 | * Screen 12 | * Sudo 13 | * Syslog-ng 14 | * TMux 15 | * VIM (Enhanced) 16 | 17 | ## Image Creation 18 | 19 | This example creates the image with the tag `internavenue/centos-base`, but you can 20 | change this to use your own username. 21 | 22 | 23 | ``` 24 | $ docker build -t="internavenue/centos-base" . 25 | ``` 26 | 27 | Alternately, you can run the following if you have *GNU Make* installed... 28 | 29 | ``` 30 | $ make 31 | ``` 32 | 33 | You can also specify a custom docker username like so: 34 | 35 | ``` 36 | $ make DOCKER_USER=internavenue 37 | ``` 38 | 39 | ## Container Creation / Running 40 | 41 | ``` shell 42 | $ mkdir -p /srv/docker/lon-dev-app1/log 43 | $ docker run -d -name="app1" \ 44 | -p 127.0.0.1:80:80 \ 45 | -v /srv/docker/lon-dev-app1/log:/var/log \ 46 | internavenue/centos-base 47 | ``` 48 | 49 | Alternately, you can run the following if you have *GNU Make* installed... 50 | 51 | ``` shell 52 | $ make run 53 | ``` 54 | 55 | You can also specify a custom port to bind to on the host, such as SSHd. 56 | 57 | ``` shell 58 | $ sudo mkdir -p /srv/docker/lon-dev-web 59 | $ make run PORT=127.0.0.1:2222 \ 60 | LOG_DIR=/my/spec/log/dir \ 61 | ``` 62 | 63 | -------------------------------------------------------------------------------- /centos-base/etc/sudoers: -------------------------------------------------------------------------------- 1 | Defaults requiretty 2 | 3 | Defaults env_reset 4 | Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS" 5 | Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE" 6 | Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES" 7 | Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE" 8 | Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY" 9 | 10 | Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin 11 | 12 | root ALL=(ALL) ALL 13 | %wheel ALL=(ALL) NOPASSWD: ALL 14 | -------------------------------------------------------------------------------- /centos-base/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | /usr/bin/ssh-keygen -A 3 | } 4 | 5 | post_start_action() { 6 | rm /first_run 7 | } 8 | -------------------------------------------------------------------------------- /centos-base/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | : # No-op 3 | } 4 | 5 | post_start_action() { 6 | : # No-op 7 | } 8 | -------------------------------------------------------------------------------- /centos-base/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up the Centos Base container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | LOG_DIR=/var/log 8 | 9 | if [[ -e /first_run ]]; then 10 | source /scripts/first_run.sh 11 | else 12 | source /scripts/normal_run.sh 13 | fi 14 | 15 | pre_start_action 16 | post_start_action 17 | 18 | echo "Starting Syslog-ng..." 19 | syslog-ng --no-caps 20 | 21 | echo "Starting SSHd..." 22 | /usr/sbin/sshd -D 23 | -------------------------------------------------------------------------------- /centos-cops/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-php:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | RUN \ 6 | yum -y --enablerepo=remi,remi-php56 install \ 7 | git \ 8 | php-pecl-sqlite && \ 9 | yum clean all 10 | 11 | # Explicit version installed, so we know we won't break anything. 12 | RUN \ 13 | mkdir -p /srv/books && \ 14 | mkdir -p /srv/www/ 15 | 16 | ADD etc/config_local.php /srv/www/config_local.php 17 | 18 | ADD scripts /scripts 19 | RUN chmod +x /scripts/start.sh 20 | RUN touch /first_run 21 | 22 | # Expose our web root and log directories log. 23 | VOLUME ["/srv/www/cops", "/srv/books", "/var/log", "/run", "/vagrant"] 24 | 25 | # Kicking in 26 | CMD ["/scripts/start.sh"] 27 | 28 | -------------------------------------------------------------------------------- /centos-cops/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /centos-cops/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own Docker index username, if you like. 2 | # Database-related variables. 3 | DOCKER_USER=internavenue 4 | DOCKER_REPO_NAME=centos-cops:centos7 5 | 6 | PORT:=127.0.0.1:9000 7 | 8 | CONTAINER_NAME:=lon-dev-cops1 9 | 10 | DATA_DIR:=/srv/docker/$(CONTAINER_NAME)/books 11 | LOGS_DIR:=/srv/docker/$(CONTAINER_NAME)/log 12 | RUN_DIR:=/srv/docker/$(CONTAINER_NAME)/run 13 | 14 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 15 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 16 | 17 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" -p $(PORT):9000 \ 18 | -v $(DATA_DIR):/srv/books \ 19 | -v $(LOGS_DIR):/var/log \ 20 | -v $(RUN_DIR):/run \ 21 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 22 | 23 | all: build 24 | 25 | dir: 26 | mkdir -p $(DATA_DIR) 27 | mkdir -p $(LOGS_DIR) 28 | mkdir -p $(RUN_DIR) 29 | 30 | build: 31 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 32 | 33 | run: clean 34 | docker run -d $(DOCKER_RUN_COMMON) 35 | 36 | bash: clean dir 37 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 38 | 39 | clean: 40 | ifneq ($(strip $(RUNNING)),) 41 | docker stop $(RUNNING) 42 | endif 43 | ifneq ($(strip $(ALL)),) 44 | docker rm $(ALL) 45 | endif 46 | 47 | # Destroys the data directory. 48 | deepclean: clean 49 | sudo rm -rf $(DATA_DIR) 50 | sudo rm -rf $(RUN_DIR) 51 | sudo rm -rf $(LOGS_DIR) 52 | 53 | -------------------------------------------------------------------------------- /centos-cops/etc/config_local.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | ENV CB_VERSION 3.0.1 6 | ENV CB_RELEASE_URL http://packages.couchbase.com/releases 7 | ENV CB_PACKAGE couchbase-server-community-3.0.1-centos6.x86_64.rpm 8 | 9 | # Add couchbase binaries to PATH 10 | ENV PATH $PATH:/opt/couchbase/bin:/opt/couchbase/bin/tools:/opt/couchbase/bin/install 11 | 12 | RUN yum install -y \ 13 | openssl \ 14 | $CB_RELEASE_URL/$CB_VERSION/$CB_PACKAGE 15 | 16 | # Modify /etc/passwd to add a login shell, otherwise running 17 | # su - couchbase -c "/opt/couchbase/bin/couchbase-server -- -noinput" 18 | # will give an error: 19 | # This account is currently not available. 20 | # This is only an issue on Couchbase Server 3.x, and it's a no-op on 2.x 21 | RUN sed -i -e 's/\/opt\/couchbase:\/sbin\/nologin/\/opt\/couchbase:\/bin\/sh/' /etc/passwd 22 | 23 | EXPOSE 4369 8091 8092 11211 11209 11210 18091 18092 11214 11215 24 | 25 | # Add start script 26 | COPY scripts/couchbase-start /usr/local/sbin/ 27 | RUN chmod +x /usr/local/sbin/couchbase-start 28 | 29 | CMD ["/usr/local/sbin/couchbase-start"] 30 | 31 | -------------------------------------------------------------------------------- /centos-couchbase-ce/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own Docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-couchbase-community:centos7 4 | 5 | PORT:=127.0.0.1:9000 6 | 7 | CONTAINER_NAME:=lon-dev-cb1 8 | 9 | DATA_DIR:=/srv/docker/$(CONTAINER_NAME)/books 10 | LOGS_DIR:=/srv/docker/$(CONTAINER_NAME)/log 11 | RUN_DIR:=/srv/docker/$(CONTAINER_NAME)/run 12 | 13 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 14 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 15 | 16 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" -p $(PORT):9000 \ 17 | -v $(DATA_DIR):/srv/books \ 18 | -v $(LOGS_DIR):/var/log \ 19 | -v $(RUN_DIR):/run \ 20 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 21 | 22 | all: build 23 | 24 | dir: 25 | mkdir -p $(DATA_DIR) 26 | mkdir -p $(LOGS_DIR) 27 | mkdir -p $(RUN_DIR) 28 | 29 | build: 30 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 31 | 32 | run: clean 33 | docker run -d $(DOCKER_RUN_COMMON) 34 | 35 | bash: clean dir 36 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 37 | 38 | clean: 39 | ifneq ($(strip $(RUNNING)),) 40 | docker stop $(RUNNING) 41 | endif 42 | ifneq ($(strip $(ALL)),) 43 | docker rm $(ALL) 44 | endif 45 | 46 | # Destroys the data directory. 47 | deepclean: clean 48 | sudo rm -rf $(DATA_DIR) 49 | sudo rm -rf $(RUN_DIR) 50 | sudo rm -rf $(LOGS_DIR) 51 | 52 | -------------------------------------------------------------------------------- /centos-couchbase-ce/scripts/couchbase-start: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -x 4 | 5 | # Couchbase Server start script. 6 | 7 | if [ "$(id -u)" != "0" ]; then 8 | echo "This script must be run as root" 9 | exit 1 10 | fi 11 | 12 | # Create directories where couchbase stores its data 13 | cd /opt/couchbase 14 | mkdir -p var/lib/couchbase \ 15 | var/lib/couchbase/config \ 16 | var/lib/couchbase/data \ 17 | var/lib/couchbase/stats \ 18 | var/lib/couchbase/logs \ 19 | var/lib/moxi 20 | chown -R couchbase:couchbase var 21 | 22 | # Increase ulimits 23 | ulimit -n 40960 24 | ulimit -c unlimited 25 | ulimit -l unlimited 26 | 27 | # Start couchbase, pass -noinput so it doesn't drop us in the erlang shell 28 | su - couchbase -c "/opt/couchbase/bin/couchbase-server -- -noinput" 29 | 30 | echo "couchbase-server finished running" 31 | 32 | -------------------------------------------------------------------------------- /centos-golang/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | RUN yum -y install tar git mercurial bzr 6 | 7 | ENV GOLANG_VERSION 1.4.2 8 | ENV GOROOT /usr/local/go 9 | ENV GOPATH /gopath 10 | 11 | RUN mkdir $GOROOT 12 | RUN mkdir $GOPATH 13 | 14 | RUN curl https://storage.googleapis.com/golang/go$GOLANG_VERSION.linux-amd64.tar.gz | tar xvzf - -C $GOROOT --strip-components=1 15 | 16 | ENV PATH $PATH:$GOROOT/bin:$GOPATH/bin -------------------------------------------------------------------------------- /centos-golang/LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /centos-haproxy/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | RUN yum -y install haproxy 6 | 7 | # Clean up YUM when done. 8 | RUN yum clean all 9 | 10 | ADD scripts /scripts 11 | RUN chmod +x /scripts/start.sh 12 | RUN touch /first_run 13 | 14 | EXPOSE 80 443 22 15 | 16 | # Expose our web root and log directories log. 17 | VOLUME ["/vagrant", "/run", "/var/lib/haproxy", "/var/log"] 18 | 19 | # Kicking in 20 | CMD ["/scripts/start.sh"] 21 | 22 | -------------------------------------------------------------------------------- /centos-haproxy/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-haproxy:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-haproxy 7 | LOG_DIR:=/srv/docker/lon-dev-haproxy1/log 8 | DATA_DIR:=/srv/docker/lon-dev-haproxy1/lib 9 | RUN_DIR:=/srv/docker/lon-dev-haproxy1/run 10 | 11 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 12 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 13 | 14 | # Because of a bug, the container has to run as privileged, 15 | # otherwise you end up with "could not open session" error. 16 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" \ 17 | -P --privileged=true \ 18 | -v $(LOG_DIR):/var/log \ 19 | -v $(DATA_DIR):/var/lib/haproxy \ 20 | -v $(RUN_DIR):/run \ 21 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 22 | 23 | all: build 24 | 25 | build: 26 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 27 | 28 | run: clean 29 | mkdir -p $(LOG_DIR) 30 | mkdir -p $(DATA_DIR) 31 | mkdir -p $(RUN_DIR) 32 | docker run -d $(DOCKER_RUN_COMMON) 33 | 34 | bash: clean 35 | mkdir -p $(LOG_DIR) 36 | mkdir -p $(DATA_DIR) 37 | mkdir -p $(RUN_DIR) 38 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 39 | 40 | # Removes existing containers. 41 | clean: 42 | ifneq ($(strip $(RUNNING)),) 43 | docker stop $(RUNNING) 44 | endif 45 | ifneq ($(strip $(ALL)),) 46 | docker rm $(ALL) 47 | endif 48 | 49 | # Deletes the directories. 50 | deepclean: clean 51 | sudo rm -rf $(LOG_DIR) 52 | sudo rm -rf $(DATA_DIR) 53 | sudo rm -rf $(RUN_DIR) 54 | -------------------------------------------------------------------------------- /centos-haproxy/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-haproxy 2 | 3 | A Dockerfile that produces a Vagrant-ready, CentOS 7-based Docker image that will run the latest stable [HAProxy][HAProxy]. 4 | 5 | The build is based on [internavenue/docker-centos-base][docker-centos-base]. 6 | 7 | [HAProxy]: http://www.haproxy.org/ 8 | 9 | ## Included packages (and their dependencies) 10 | 11 | * HAProxy 12 | 13 | ## Image Creation 14 | 15 | This example creates the image with the tag `internavenue/centos-haproxy`, but you can 16 | change this to use your own username. 17 | 18 | ``` 19 | $ docker build -t="internavenue/centos-haproxy" . 20 | ``` 21 | 22 | Alternately, you can run the following if you have *GNU Make* installed... 23 | 24 | ``` 25 | $ make 26 | ``` 27 | 28 | You can also specify a custom docker username like so: 29 | 30 | ``` 31 | $ make DOCKER_USER=internavenue 32 | ``` 33 | 34 | ## Container Creation / Running 35 | 36 | The HAProxy load balancer can be configured to use external volumes, such as 37 | * /var/log - for logging 38 | * /run - to access the haproxy.pid; useful if you want to send signals from the host 39 | * /vagrant - if you want to the image with Vagrant 40 | * /var/lib/haproxy - to examine runtime offline data that HAProxy produce. 41 | 42 | This example uses `/srv/docker/lon-dev-haproxy` to host the web application, but you can modify 43 | this to your needs. 44 | 45 | 46 | ``` shell 47 | $ mkdir -p /srv/docker/lon-dev-haproxy 48 | $ docker run -d -name="lon-dev-haproxy" \ 49 | -p 127.0.0.1:80:80 \ 50 | -v /srv/docker/lon-dev-haproxy/log:/var/log \ 51 | -v /srv/docker/lon-dev-haproxy/run:/run \ 52 | -v /srv/docker/lon-dev-haproxy/lib:/var/lib/haproxy \ 53 | internavenue/centos-haproxy 54 | ``` 55 | 56 | Alternately, you can run the following if you have *GNU Make* installed... 57 | 58 | ``` shell 59 | $ make run 60 | ``` 61 | 62 | You can also specify a custom port to bind to on the host, a custom web root 63 | directory, and the superuser username and password on the host like so: 64 | 65 | ``` shell 66 | $ sudo mkdir -p /srv/docker/lon-dev-haproxy 67 | $ make run PORT=127.0.0.1:8080 \ 68 | DATA_DIR=/my/spec/data/dir \ 69 | ``` 70 | 71 | -------------------------------------------------------------------------------- /centos-haproxy/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | /usr/bin/ssh-keygen -A 3 | mkdir -p $DATA_DIR 4 | mkdir -p "$LOG_DIR/haproxy" 5 | } 6 | 7 | post_start_action() { 8 | rm /first_run 9 | } 10 | -------------------------------------------------------------------------------- /centos-haproxy/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | : # No-op 3 | } 4 | 5 | post_start_action() { 6 | : # No-op 7 | } 8 | -------------------------------------------------------------------------------- /centos-haproxy/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up the Phabricator stack within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | DATA_DIR=/var/lib/haproxy 8 | LOG_DIR=/var/log 9 | 10 | if [[ -e /first_run ]]; then 11 | source /scripts/first_run.sh 12 | else 13 | source /scripts/normal_run.sh 14 | fi 15 | 16 | pre_start_action 17 | post_start_action 18 | 19 | chown haproxy:haproxy $DATA_DIR 20 | chown haproxy:haproxy "$LOG_DIR/haproxy" 21 | 22 | echo "Starting Syslog-ng..." 23 | syslog-ng --no-caps 24 | 25 | echo "Starting SSHd..." 26 | /usr/sbin/sshd 27 | 28 | echo "Starting HAproxy..." 29 | /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid 30 | -------------------------------------------------------------------------------- /centos-jenkins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | RUN curl -SL http://pkg.jenkins-ci.org/redhat/jenkins.repo -o /etc/yum.repos.d/jenkins.repo && \ 6 | rpm --import http://pkg.jenkins-ci.org/redhat/jenkins-ci.org.key 7 | 8 | RUN yum -y install \ 9 | bzip2 \ 10 | java-1.8.0-openjdk \ 11 | java-1.8.0-openjdk-devel \ 12 | git \ 13 | initscripts \ 14 | tar \ 15 | jenkins && \ 16 | yum clean all 17 | 18 | ADD scripts /scripts 19 | RUN chmod +x /scripts/start.sh 20 | RUN touch /first_run 21 | 22 | # The --deaemon removed from the init file. 23 | ADD etc/jenkins /etc/init.d/jenkins.nodaemon 24 | RUN chmod +x /etc/init.d/jenkins.nodaemon 25 | 26 | EXPOSE 8080 22 27 | 28 | # Expose our web root and log directories log. 29 | VOLUME ["/var/lib/jenkins", "/var/log", "/run", "/vagrant"] 30 | 31 | # Kicking in 32 | CMD ["/scripts/start.sh"] 33 | 34 | -------------------------------------------------------------------------------- /centos-jenkins/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-jenkins:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-ci 7 | LOG_DIR:=/srv/docker/lon-dev-ci/log 8 | DATA_DIR:=/srv/docker/lon-dev-ci/data 9 | 10 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 11 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 12 | 13 | # Because of a bug, the container has to run as privileged, 14 | # otherwise you end up with "could not open session" error. 15 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" \ 16 | --privileged \ 17 | -P \ 18 | -v $(LOG_DIR):/var/log \ 19 | -v $(DATA_DIR):/var/lib/jenkins \ 20 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 21 | 22 | all: build 23 | 24 | build: 25 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 26 | 27 | run: clean 28 | mkdir -p $(LOG_DIR) 29 | mkdir -p $(DATA_DIR) 30 | docker run -d $(DOCKER_RUN_COMMON) 31 | 32 | bash: clean 33 | mkdir -p $(LOG_DIR) 34 | mkdir -p $(DATA_DIR) 35 | docker run --privileged -t -i $(DOCKER_RUN_COMMON) /bin/bash 36 | 37 | # Removes existing containers. 38 | clean: 39 | ifneq ($(strip $(RUNNING)),) 40 | docker stop $(RUNNING) 41 | endif 42 | ifneq ($(strip $(ALL)),) 43 | docker rm $(ALL) 44 | endif 45 | 46 | # Deletes the directories. 47 | deepclean: clean 48 | sudo rm -rf $(LOG_DIR) 49 | sudo rm -rf $(DATA_DIR) 50 | -------------------------------------------------------------------------------- /centos-jenkins/etc/jenkins: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # SUSE system statup script for Jenkins 4 | # Copyright (C) 2007 Pascal Bleser 5 | # 6 | # This library is free software; you can redistribute it and/or modify it 7 | # under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation; either version 2.1 of the License, or (at 9 | # your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, but 12 | # WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | # Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, 19 | # USA. 20 | # 21 | ### BEGIN INIT INFO 22 | # Provides: jenkins 23 | # Required-Start: $local_fs $remote_fs $network $time $named 24 | # Should-Start: $time sendmail 25 | # Required-Stop: $local_fs $remote_fs $network $time $named 26 | # Should-Stop: $time sendmail 27 | # Default-Start: 3 5 28 | # Default-Stop: 0 1 2 6 29 | # Short-Description: Jenkins continuous build server 30 | # Description: Start the Jenkins continuous build server 31 | ### END INIT INFO 32 | 33 | # Check for missing binaries (stale symlinks should not happen) 34 | JENKINS_WAR="/usr/lib/jenkins/jenkins.war" 35 | test -r "$JENKINS_WAR" || { echo "$JENKINS_WAR not installed"; 36 | if [ "$1" = "stop" ]; then exit 0; 37 | else exit 5; fi; } 38 | 39 | # Check for existence of needed config file and read it 40 | JENKINS_CONFIG=/etc/sysconfig/jenkins 41 | test -e "$JENKINS_CONFIG" || { echo "$JENKINS_CONFIG not existing"; 42 | if [ "$1" = "stop" ]; then exit 0; 43 | else exit 6; fi; } 44 | test -r "$JENKINS_CONFIG" || { echo "$JENKINS_CONFIG not readable. Perhaps you forgot 'sudo'?"; 45 | if [ "$1" = "stop" ]; then exit 0; 46 | else exit 6; fi; } 47 | 48 | JENKINS_PID_FILE="/var/run/jenkins.pid" 49 | 50 | # Source function library. 51 | . /etc/init.d/functions 52 | 53 | # Read config 54 | [ -f "$JENKINS_CONFIG" ] && . "$JENKINS_CONFIG" 55 | 56 | # Set up environment accordingly to the configuration settings 57 | [ -n "$JENKINS_HOME" ] || { echo "JENKINS_HOME not configured in $JENKINS_CONFIG"; 58 | if [ "$1" = "stop" ]; then exit 0; 59 | else exit 6; fi; } 60 | [ -d "$JENKINS_HOME" ] || { echo "JENKINS_HOME directory does not exist: $JENKINS_HOME"; 61 | if [ "$1" = "stop" ]; then exit 0; 62 | else exit 1; fi; } 63 | 64 | # Search usable Java. We do this because various reports indicated 65 | # that /usr/bin/java may not always point to Java 1.5 66 | # see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html 67 | for candidate in /etc/alternatives/java /usr/lib/jvm/java-1.6.0/bin/java /usr/lib/jvm/jre-1.6.0/bin/java /usr/lib/jvm/java-1.5.0/bin/java /usr/lib/jvm/jre-1.5.0/bin/java /usr/bin/java 68 | do 69 | [ -x "$JENKINS_JAVA_CMD" ] && break 70 | JENKINS_JAVA_CMD="$candidate" 71 | done 72 | 73 | JAVA_CMD="$JENKINS_JAVA_CMD $JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR" 74 | PARAMS="--logfile=/var/log/jenkins/jenkins.log --webroot=/var/cache/jenkins/war" 75 | [ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT" 76 | [ -n "$JENKINS_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --httpListenAddress=$JENKINS_LISTEN_ADDRESS" 77 | [ -n "$JENKINS_HTTPS_PORT" ] && PARAMS="$PARAMS --httpsPort=$JENKINS_HTTPS_PORT" 78 | [ -n "$JENKINS_HTTPS_KEYSTORE" ] && PARAMS="$PARAMS --httpsKeyStore=$JENKINS_HTTPS_KEYSTORE" 79 | [ -n "$JENKINS_HTTPS_KEYSTORE_PASSWORD" ] && PARAMS="$PARAMS --httpsKeyStorePassword='$JENKINS_HTTPS_KEYSTORE_PASSWORD'" 80 | [ -n "$JENKINS_HTTPS_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --httpsListenAddress=$JENKINS_HTTPS_LISTEN_ADDRESS" 81 | [ -n "$JENKINS_AJP_PORT" ] && PARAMS="$PARAMS --ajp13Port=$JENKINS_AJP_PORT" 82 | [ -n "$JENKINS_AJP_LISTEN_ADDRESS" ] && PARAMS="$PARAMS --ajp13ListenAddress=$JENKINS_AJP_LISTEN_ADDRESS" 83 | [ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL" 84 | [ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP" 85 | [ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX" 86 | [ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE" 87 | [ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS" 88 | 89 | if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then 90 | PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log" 91 | fi 92 | 93 | RETVAL=0 94 | 95 | case "$1" in 96 | start) 97 | echo -n "Starting Jenkins " 98 | daemon --user "$JENKINS_USER" --pidfile "$JENKINS_PID_FILE" $JAVA_CMD $PARAMS > /dev/null 99 | RETVAL=$? 100 | if [ $RETVAL = 0 ]; then 101 | success 102 | echo > "$JENKINS_PID_FILE" # just in case we fail to find it 103 | MY_SESSION_ID=`/bin/ps h -o sess -p $$` 104 | # get PID 105 | /bin/ps hww -u "$JENKINS_USER" -o sess,ppid,pid,cmd | \ 106 | while read sess ppid pid cmd; do 107 | [ "$ppid" = 1 ] || continue 108 | # this test doesn't work because Jenkins sets a new Session ID 109 | # [ "$sess" = "$MY_SESSION_ID" ] || continue 110 | echo "$cmd" | grep $JENKINS_WAR > /dev/null 111 | [ $? = 0 ] || continue 112 | # found a PID 113 | echo $pid > "$JENKINS_PID_FILE" 114 | done 115 | else 116 | failure 117 | fi 118 | echo 119 | ;; 120 | stop) 121 | echo -n "Shutting down Jenkins " 122 | killproc jenkins 123 | RETVAL=$? 124 | echo 125 | ;; 126 | try-restart|condrestart) 127 | if test "$1" = "condrestart"; then 128 | echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" 129 | fi 130 | $0 status 131 | if test $? = 0; then 132 | $0 restart 133 | else 134 | : # Not running is not a failure. 135 | fi 136 | ;; 137 | restart) 138 | $0 stop 139 | $0 start 140 | ;; 141 | force-reload) 142 | echo -n "Reload service Jenkins " 143 | $0 try-restart 144 | ;; 145 | reload) 146 | $0 restart 147 | ;; 148 | status) 149 | status jenkins 150 | RETVAL=$? 151 | ;; 152 | probe) 153 | ## Optional: Probe for the necessity of a reload, print out the 154 | ## argument to this init script which is required for a reload. 155 | ## Note: probe is not (yet) part of LSB (as of 1.9) 156 | 157 | test "$JENKINS_CONFIG" -nt "$JENKINS_PID_FILE" && echo reload 158 | ;; 159 | *) 160 | echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" 161 | exit 1 162 | ;; 163 | esac 164 | exit $RETVAL 165 | -------------------------------------------------------------------------------- /centos-jenkins/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | mkdir -p $DATA_DIR 3 | mkdir -p "$LOG_DIR/jenkins" 4 | } 5 | 6 | post_start_action() { 7 | rm /first_run 8 | } 9 | -------------------------------------------------------------------------------- /centos-jenkins/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | : # No-op 3 | } 4 | 5 | post_start_action() { 6 | : # No-op 7 | } 8 | -------------------------------------------------------------------------------- /centos-jenkins/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up the Jenkins stack within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | DATA_DIR=/var/lib/jenkins 8 | LOG_DIR=/var/log 9 | 10 | if [[ -e /first_run ]]; then 11 | source /scripts/first_run.sh 12 | else 13 | source /scripts/normal_run.sh 14 | fi 15 | 16 | pre_start_action 17 | post_start_action 18 | 19 | chown jenkins:jenkins $DATA_DIR 20 | chown jenkins:jenkins "$LOG_DIR/jenkins" 21 | 22 | echo "Starting Syslog-ng..." 23 | syslog-ng --no-caps 24 | 25 | echo "Starting SSHd..." 26 | /usr/sbin/sshd 27 | 28 | echo "Starting Nginx..." 29 | /etc/init.d/jenkins.nodaemon start 30 | -------------------------------------------------------------------------------- /centos-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | # Install the Nginx.org CentOS repo. 6 | ADD etc/nginx.repo /etc/yum.repos.d/nginx.repo 7 | 8 | # Install base stuff. 9 | RUN yum -y install \ 10 | nginx \ 11 | unzip 12 | 13 | # Clean up YUM when done. 14 | RUN yum clean all 15 | 16 | RUN mkdir /srv/www 17 | 18 | # Replace the stock config with a nicer one. 19 | RUN rm -rf /etc/nginx 20 | 21 | # Unfortunately, because of a bug in hub.docker.com, 22 | # we can't use Git submodules here to drop modules in. 23 | RUN cd /tmp && \ 24 | curl -L -o server-configs-nginx.zip https://github.com/h5bp/server-configs-nginx/archive/master.zip && \ 25 | unzip server-configs-nginx.zip && \ 26 | mv server-configs-nginx-master /etc/nginx 27 | 28 | RUN mkdir /etc/nginx/conf 29 | RUN sed -ri 's/user www www;/user nginx nginx;\n\n# Run Nginx in the foreground for Docker.\ndaemon off;/g' /etc/nginx/nginx.conf 30 | RUN sed -ri 's/logs\/error.log/\/var\/log\/nginx\/error.log/g' /etc/nginx/nginx.conf 31 | RUN sed -ri 's/logs\/access.log/\/var\/log\/nginx\/access.log/g' /etc/nginx/nginx.conf 32 | RUN sed -ri 's/logs\/static.log/\/var\/log\/nginx\/static.log/g' /etc/nginx/h5bp/location/expires.conf 33 | 34 | # Don't run Nginx as a daemon. This lets the docker host monitor the process. 35 | RUN ln -s /etc/nginx/sites-available/no-default /etc/nginx/sites-enabled 36 | 37 | EXPOSE 80 22 38 | 39 | ADD scripts /scripts 40 | RUN chmod +x /scripts/start.sh 41 | 42 | # Expose our web root and log directories log. 43 | VOLUME ["/vagrant", "/srv/www", "/var/log", "/var/run"] 44 | 45 | # Kicking in 46 | CMD ["/scripts/start.sh"] 47 | 48 | -------------------------------------------------------------------------------- /centos-nginx/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-nginx:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-web1 7 | USER:=super 8 | PASS:=Whatz03v3r 9 | DATA_DIR:=/srv/docker/lon-dev-web1/www 10 | LOG_DIR:=/srv/docker/lon-dev-web1/log 11 | RUN_DIR:=/srv/docker/lon-dev-web1/run 12 | VAGRANT_DIR:=/srv/docker/lon-dev-web1/vagrant 13 | PORT:=127.0.0.1:81 14 | 15 | RUNNING:=$(shell docker ps | grep $(CONTAINER_NAME) | cut -f 1 -d ' ') 16 | ALL:=$(shell docker ps -a | grep $(CONTAINER_NAME) | cut -f 1 -d ' ') 17 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" -p $(PORT):80 \ 18 | -P --privileged=true \ 19 | -v $(DATA_DIR):/srv/www \ 20 | -v $(LOG_DIR):/var/log \ 21 | -v $(RUN_DIR):/var/run \ 22 | -v $(VAGRANT_DIR):/vagrant \ 23 | -e USER="$(USER)" -e PASS="$(PASS)" $(DOCKER_USER)/$(DOCKER_REPO_NAME) 24 | 25 | all: build 26 | 27 | build: 28 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 29 | 30 | run: clean 31 | mkdir -p $(DATA_DIR) 32 | docker run -d $(DOCKER_RUN_COMMON) 33 | 34 | bash: clean 35 | mkdir -p $(DATA_DIR) 36 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 37 | 38 | # Removes existing containers. 39 | clean: 40 | ifneq ($(strip $(RUNNING)),) 41 | docker stop $(RUNNING) 42 | endif 43 | ifneq ($(strip $(ALL)),) 44 | docker rm $(ALL) 45 | endif 46 | 47 | # Destroys the data directory. 48 | deepclean: clean 49 | sudo rm -rf $(DATA_DIR) 50 | -------------------------------------------------------------------------------- /centos-nginx/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-nginx 2 | 3 | A Dockerfile that produces a CentOS-based Docker image that will run the latest stable [Nginx][nginx]. 4 | 5 | It is ideal to be a base image to serve out [PHP-FPM][phpfpm] or as a [Puppet Master][puppet] load balancer. 6 | 7 | The build is based on [internavenue/docker-centos-base][docker-centos-base]. 8 | 9 | [nginx]: http://nginx.org/ 10 | [phpfpm]: http://php-fpm.org/ 11 | [puppet]: http://puppetlabs.com/puppet 12 | 13 | ## Included packages (and their dependencies) 14 | 15 | * Nginx 16 | * [H5BP Nginx boilerplate][h5bp] 17 | 18 | [h5bp]: https://github.com/h5bp/server-configs-nginx 19 | 20 | ## Image Creation 21 | 22 | This example creates the image with the tag `internavenue/centos-nginx`, but you can 23 | change this to use your own username. 24 | 25 | 26 | ``` 27 | $ docker build -t="internavenue/centos-nginx" . 28 | ``` 29 | 30 | Alternately, you can run the following if you have *GNU Make* installed... 31 | 32 | ``` 33 | $ make 34 | ``` 35 | 36 | You can also specify a custom docker username like so: 37 | 38 | ``` 39 | $ make DOCKER_USER=internavenue 40 | ``` 41 | 42 | ## Container Creation / Running 43 | 44 | The Nginx web server is configured to store web root in `/srv/www` inside the container. 45 | You can map the container's `/srv/www` volume to a volume on the host so the data 46 | becomes independant of the running container. 47 | 48 | This example uses `/srv/docker/lon-dev-web` to host the web application, but you can modify 49 | this to your needs. 50 | 51 | When the container runs, it creates a superuser with a random password. You 52 | can set the username and password for the superuser by setting the container's 53 | environment variables. This lets you discover the username and password of the 54 | superuser from within a linked container or from the output of `docker inspect 55 | web1`. 56 | 57 | ``` shell 58 | $ mkdir -p /srv/docker/lon-dev-web 59 | $ docker run -d -name="web1" \ 60 | -p 127.0.0.1:80:80 \ 61 | -v /srv/docker/lon-dev-web:/srv/www \ 62 | -e USER="super" \ 63 | -e PASS="Whatz03v3r" \ 64 | internavenue/nginx 65 | ``` 66 | 67 | Alternately, you can run the following if you have *GNU Make* installed... 68 | 69 | ``` shell 70 | $ make run 71 | ``` 72 | 73 | You can also specify a custom port to bind to on the host, a custom web root 74 | directory, and the superuser username and password on the host like so: 75 | 76 | ``` shell 77 | $ sudo mkdir -p /srv/docker/lon-dev-web 78 | $ make run PORT=127.0.0.1:8080 \ 79 | DATA_DIR=/my/spec/data/dir \ 80 | USER=super \ 81 | PASS=Whatz03v3r 82 | ``` 83 | 84 | -------------------------------------------------------------------------------- /centos-nginx/etc/nginx.repo: -------------------------------------------------------------------------------- 1 | [nginx] 2 | name=nginx repo 3 | baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ 4 | gpgcheck=0 5 | enabled=1 6 | -------------------------------------------------------------------------------- /centos-nginx/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | /usr/bin/ssh-keygen -A 3 | mkdir -p $DATA_DIR 4 | mkdir -p "$LOG_DIR/nginx" 5 | } 6 | 7 | post_start_action() { 8 | rm /first_run 9 | } 10 | -------------------------------------------------------------------------------- /centos-nginx/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | : # No-op 3 | } 4 | 5 | post_start_action() { 6 | : # No-op 7 | } 8 | -------------------------------------------------------------------------------- /centos-nginx/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up Nginx within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | DATA_DIR=/srv/www 8 | LOG_DIR=/var/log 9 | 10 | # Check if the data directory does not exist. 11 | if [ ! -d "$LOG_DIR/nginx" ]; then 12 | mkdir -p "$LOG_DIR/nginx" 13 | fi 14 | 15 | if [[ -e /first_run ]]; then 16 | source /scripts/first_run.sh 17 | else 18 | source /scripts/normal_run.sh 19 | fi 20 | 21 | chown -R nginx:nginx "$LOG_DIR/nginx" 22 | 23 | echo "Starting Syslog-ng..." 24 | syslog-ng --no-caps 25 | 26 | echo "Starting SSHd..." 27 | /usr/sbin/sshd 28 | 29 | echo "Starting Nginx..." 30 | /usr/sbin/nginx 31 | 32 | -------------------------------------------------------------------------------- /centos-nlp4l/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | ENV SCALA_URL http://downloads.typesafe.com/scala 6 | ENV SCALA_VERSION 2.11.7 7 | 8 | RUN yum install -y \ 9 | git \ 10 | tar \ 11 | unzip \ 12 | wget \ 13 | java-1.8.0-openjdk \ 14 | java-1.8.0-openjdk-devel \ 15 | npm && \ 16 | yum clean all 17 | 18 | #Install Maven (needed for converting Wikipedia data into Lucene index) 19 | 20 | RUN \ 21 | curl http://mirrors.ukfast.co.uk/sites/ftp.apache.org/maven/maven-3/3.3.1/binaries/apache-maven-3.3.1-bin.zip -o apache-maven-3.3.1-bin.zip && \ 22 | unzip apache-maven-3.3.1-bin.zip && \ 23 | mv apache-maven-3.3.1/ /opt/maven && \ 24 | ln -s /opt/maven/bin/mvn /usr/bin/mvn 25 | 26 | #Install Scala 27 | RUN \ 28 | curl $SCALA_URL/$SCALA_VERSION/scala-$SCALA_VERSION.tgz | tar xvz 29 | RUN \ 30 | mv scala-$SCALA_VERSION /usr/lib/ && \ 31 | ln -s /usr/lib/scala-$SCALA_VERSION /usr/lib/scala 32 | 33 | ENV PATH $PATH:/usr/lib/scala/bin 34 | 35 | #Install sbt 36 | RUN curl https://bintray.com/sbt/rpm/rpm | tee /etc/yum.repos.d/bintray-sbt-rpm.repo 37 | RUN yum install -y sbt 38 | 39 | #Install NLP4L 40 | RUN git clone https://github.com/NLP4L/nlp4l /nlp4l 41 | WORKDIR /nlp4l 42 | RUN sbt pack 43 | -------------------------------------------------------------------------------- /centos-nlp4l/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-nlp4l 2 | 3 | A Dockerfile that produces a Centos-based Docker image that will run the latest [NLP4L][nlp4l] 4 | 5 | [nlp4l]: https://github.com/NLP4L/nlp4l 6 | 7 | 8 | ## Image Creation 9 | 10 | This example creates the image with the tag `internavenue/centos-nlp4l`, but you can change this to use your own username. 11 | 12 | 13 | ``` 14 | $ docker build -t="internavenue/centos-nlp4l" . 15 | ``` 16 | 17 | ## Usage 18 | 19 | ``` 20 | sudo docker run -t -i -p internavenue/centos-nlp4l:centos7 21 | ``` 22 | 23 | Once inside, you can run NLP4l with 24 | 25 | ``` 26 | target/pack/bin/nlp4l 27 | ``` 28 | By default, NLP4L code for generating the Lucene indices of different corpora is /tmp, therefore you should map this directory to somewhere in the host. If you also want to map downloaded corpora in the host to the default location within the NLP4L working directory then you should: 29 | 30 | ``` 31 | sudo docker run -v ~/nlp/corpora:/nlp4l/corpora -v ~/nlp/indices:/tmp -ti internavenue/centos-nlp4l bash 32 | ``` 33 | -------------------------------------------------------------------------------- /centos-nsq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | RUN yum -y install tar 6 | 7 | ADD https://github.com/bitly/nsq/releases/download/v0.3.5/nsq-0.3.5.linux-amd64.go1.4.2.tar.gz /var/tmp/ 8 | RUN \ 9 | mkdir -p /var/tmp/nsq && \ 10 | tar -xzf /var/tmp/nsq-0.3.5.linux-amd64.go1.4.2.tar.gz --strip=1 -C /var/tmp/nsq/ && \ 11 | mv /var/tmp/nsq/bin/* /usr/local/sbin && \ 12 | rm -rf /var/tmp/nsq* 13 | 14 | RUN yum -y remove tar && yum clean all 15 | 16 | COPY scripts /scripts 17 | RUN chmod +x /scripts/start.sh 18 | 19 | # Expose ports. 20 | EXPOSE 4150 4151 4160 4161 4171 22 21 | 22 | VOLUME ["/vagrant", "/data", "/var/log", "/run", "/etc/ssl/certs"] 23 | 24 | # Kicking in 25 | CMD ["/scripts/start.sh"] 26 | -------------------------------------------------------------------------------- /centos-nsq/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=nsqd:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME_NSQD:=lon-dev-nsqd1 7 | CONTAINER_NAME_NSQLOOKUPD:=lon-dev-nsqlookupd1 8 | CONTAINER_NAME_NSQADMIN:=lon-dev-nsqadmin1 9 | 10 | DATA_DIR_NSQD:=/srv/docker/lon-dev-nsqd1/data 11 | 12 | VAGRANT_DIR:=/srv/docker/lon-dev-nsqd1/vagrant 13 | PORT_NSQADMIN:=127.0.0.1:4171 14 | 15 | RUNNING_NSQD:=$(shell docker ps | grep "$(CONTAINER_NAME_NSQD) " | cut -f 1 -d ' ') 16 | RUNNING_NSQLOOKUPD:=$(shell docker ps | grep "$(CONTAINER_NAME_NSQLOOKUPD) " | cut -f 1 -d ' ') 17 | RUNNING_NSQADMIN:=$(shell docker ps | grep "$(CONTAINER_NAME_NSQADMIN) " | cut -f 1 -d ' ') 18 | 19 | ALL_NSQD:=$(shell docker ps -a | grep "$(CONTAINER_NAME_NSQD) " | cut -f 1 -d ' ') 20 | ALL_NSQLOOKUPD:=$(shell docker ps -a | grep "$(CONTAINER_NAME_NSQLOOKUPD) " | cut -f 1 -d ' ') 21 | ALL_NSQADMIN:=$(shell docker ps -a | grep "$(CONTAINER_NAME_NSQADMIN) " | cut -f 1 -d ' ') 22 | 23 | DOCKER_RUN_COMMON_NSQD=--name="$(CONTAINER_NAME_NSQD)" \ 24 | -v $(DATA_DIR_NSQD):/data \ 25 | -v $(VAGRANT_DIR):/vagrant \ 26 | --link $(CONTAINER_NAME_NSQLOOKUPD):$(CONTAINER_NAME_NSQLOOKUPD) \ 27 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 28 | 29 | DOCKER_RUN_COMMON_NSQLOOKUPD=--name="$(CONTAINER_NAME_NSQLOOKUPD)" \ 30 | -v $(VAGRANT_DIR):/vagrant \ 31 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 32 | 33 | DOCKER_RUN_COMMON_NSQADMIN=--name="$(CONTAINER_NAME_NSQADMIN)" \ 34 | -v $(VAGRANT_DIR):/vagrant \ 35 | -p $(PORT_NSQADMIN):4171 \ 36 | --link $(CONTAINER_NAME_NSQLOOKUPD):$(CONTAINER_NAME_NSQLOOKUPD) \ 37 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 38 | 39 | all: build 40 | 41 | build: 42 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 43 | 44 | nsqlookupd_run: nsqlookupd_clean 45 | docker run -d $(DOCKER_RUN_COMMON_NSQLOOKUPD) nsqlookupd 46 | 47 | nsqlookupd_bash: nsqlookupd_clean 48 | docker run -t -i $(DOCKER_RUN_COMMON_NSQLOOKUPD) /bin/bash 49 | 50 | nsqd_run: nsqd_clean 51 | mkdir -p $(DATA_DIR_NSQD) 52 | docker run -d $(DOCKER_RUN_COMMON_NSQD) nsqd --data-path /data --lookupd-tcp-address $(CONTAINER_NAME_NSQLOOKUPD):4160 53 | 54 | nsqd_bash: nsqd_clean 55 | mkdir -p $(DATA_DIR_NSQD) 56 | docker run -t -i $(DOCKER_RUN_COMMON_NSQD) /bin/bash 57 | 58 | nsqadmin_run: nsqadmin_clean 59 | docker run -d $(DOCKER_RUN_COMMON_NSQADMIN) nsqadmin --lookupd-http-address $(CONTAINER_NAME_NSQLOOKUPD):4161 60 | 61 | nsqadmin_bash: nsqadmin_clean 62 | docker run -t -i $(DOCKER_RUN_COMMON_NSQADMIN) /bin/bash 63 | 64 | run: nsqlookupd_run nsqd_run nsqadmin_run 65 | 66 | # Removes existing containers. 67 | nsqadmin_clean: 68 | ifneq ($(strip $(RUNNING_NSQADMIN)),) 69 | docker stop $(RUNNING_NSQADMIN) 70 | endif 71 | ifneq ($(strip $(ALL_NSQADMIN)),) 72 | docker rm $(ALL_NSQADMIN) 73 | endif 74 | 75 | nsqd_clean: 76 | ifneq ($(strip $(RUNNING_NSQD)),) 77 | docker stop $(RUNNING_NSQD) 78 | endif 79 | ifneq ($(strip $(ALL_NSQD)),) 80 | docker rm $(ALL_NSQD) 81 | endif 82 | 83 | nsqlookupd_clean: 84 | ifneq ($(strip $(RUNNING_NSQLOOKUPD)),) 85 | docker stop $(RUNNING_NSQLOOKUPD) 86 | endif 87 | ifneq ($(strip $(ALL_NSQLOOKUPD)),) 88 | docker rm $(ALL_NSQLOOKUPD) 89 | endif 90 | 91 | clean: nsqadmin_clean nsqd_clean nsqlookupd_clean 92 | 93 | # Destroys the data directory. 94 | deepclean: clean 95 | sudo rm -rf $(DATA_DIR_NSQD) 96 | -------------------------------------------------------------------------------- /centos-nsq/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | /usr/bin/ssh-keygen -A 3 | mkdir -p $DATA_DIR 4 | mkdir -p "$LOG_DIR/nsq" 5 | } 6 | 7 | post_start_action() { 8 | rm /first_run 9 | } 10 | -------------------------------------------------------------------------------- /centos-nsq/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | : # No-op 3 | } 4 | 5 | post_start_action() { 6 | : # No-op 7 | } 8 | -------------------------------------------------------------------------------- /centos-nsq/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up NSQd within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | DATA_DIR=/data 8 | LOG_DIR=/var/log 9 | 10 | # Check if the data directory does not exist. 11 | if [ ! -d "$LOG_DIR/nsq" ]; then 12 | mkdir -p "$LOG_DIR/nsq" 13 | fi 14 | 15 | if [[ -e /first_run ]]; then 16 | source /scripts/first_run.sh 17 | else 18 | source /scripts/normal_run.sh 19 | fi 20 | 21 | echo "Starting Syslog-ng..." 22 | syslog-ng --no-caps 23 | 24 | echo "Starting SSHd..." 25 | /usr/sbin/sshd 26 | 27 | echo "Starting Bash..." 28 | /bin/bash 29 | -------------------------------------------------------------------------------- /centos-percona/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | MAINTAINER Intern Avenue Dev Team2 3 | 4 | # Install EPEL 5 | RUN rpm -Uvh http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm 6 | 7 | # Install base stuff. 8 | RUN yum -y install \ 9 | hostname \ 10 | Percona-Server-client-56 \ 11 | Percona-Server-server-56 \ 12 | Percona-Server-shared-56 \ 13 | percona-xtrabackup \ 14 | unzip 15 | 16 | # The inotify-tools is not available in the stable repo (yet). 17 | RUN yum install -y --enablerepo=epel-testing inotify-tools 18 | 19 | # Clean up YUM when done. 20 | RUN yum clean all 21 | 22 | # Percona does not come with default config file. 23 | ADD etc/my.cnf /etc/my.cnf 24 | ADD etc/percona.init.sh /etc/init.d/mysqld 25 | RUN chmod +x /etc/init.d/mysqld 26 | 27 | # Configure the database to use our data dir. 28 | RUN sed -i -e 's/^datadir\s*=.*/datadir = \/data/' /etc/my.cnf 29 | 30 | # Configure Percona to listen on any address. 31 | RUN sed -i -e 's/^bind-address/#bind-address/' /etc/my.cnf 32 | 33 | EXPOSE 3306 22 34 | 35 | ADD scripts /scripts 36 | RUN chmod +x /scripts/start.sh 37 | RUN touch /first_run 38 | 39 | # Expose our data, log, and configuration directories. 40 | VOLUME ["/vagrant", "/data", "/var/log", "/run"] 41 | 42 | # Kicking in 43 | CMD ["/scripts/start.sh"] 44 | -------------------------------------------------------------------------------- /centos-percona/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | 4 | # Change this to suit your needs. 5 | CONTAINER_NAME:=lon-dev-db 6 | USER:=super 7 | PASS:=Whatz03v3r 8 | DATA_DIR:=/srv/docker/lon-dev-db/data 9 | LOG_DIR:=/srv/docker/lon-dev-db/log 10 | RUN_DIR:=/srv/docker/lon-dev-db/run 11 | PORT:=127.0.0.1:3306 12 | 13 | RUNNING:=$(shell docker ps | grep $(CONTAINER_NAME) | cut -f 1 -d ' ') 14 | ALL:=$(shell docker ps -a | grep $(CONTAINER_NAME) | cut -f 1 -d ' ') 15 | DOCKER_RUN_COMMON=\ 16 | --name="$(CONTAINER_NAME)" \ 17 | --privileged=true \ 18 | -p $(PORT):3306 \ 19 | -v $(DATA_DIR):/data \ 20 | -v $(LOG_DIR):/var/log \ 21 | -v $(RUN_DIR):/run \ 22 | -e USER="$(USER)" \ 23 | -e PASS="$(PASS)" \ 24 | $(DOCKER_USER)/centos-percona:centos7 25 | 26 | all: build 27 | 28 | build: 29 | docker build -t="$(DOCKER_USER)/centos-percona:centos7" . 30 | 31 | run: clean 32 | mkdir -p $(DATA_DIR) 33 | docker run -d $(DOCKER_RUN_COMMON) 34 | 35 | bash: clean 36 | mkdir -p $(DATA_DIR) 37 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 38 | 39 | # Removes existing containers. 40 | clean: 41 | ifneq ($(strip $(RUNNING)),) 42 | docker stop $(RUNNING) 43 | endif 44 | ifneq ($(strip $(ALL)),) 45 | docker rm $(ALL) 46 | endif 47 | 48 | # Destroys the data directory. 49 | deepclean: clean 50 | sudo rm -rf $(DATA_DIR) 51 | -------------------------------------------------------------------------------- /centos-percona/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-percona 2 | 3 | A Dockerfile that produces a Centos-based Docker image that will run the latest stable [Percona][percona]. 4 | 5 | This Dockerfile and the scripts are based on [Ryan Seto][paintedfox]'s excellent [docker-mariadb][docker-mariadb] 6 | repo. Thanks, mate! 7 | 8 | [percona]: http://www.percona.com/software/percona-server 9 | [paintedfox]: https://github.com/Painted-Fox 10 | [docker-mariadb]: https://github.com/Painted-Fox/docker-mariadb 11 | 12 | ## Image Creation 13 | 14 | This example creates the image with the tag `internavenue/centos-percona`, but you can 15 | change this to use your own username. 16 | 17 | 18 | ``` 19 | $ docker build -t="internavenue/centos-percona" . 20 | ``` 21 | 22 | Alternately, you can run the following if you have *GNU Make* installed... 23 | 24 | ``` 25 | $ make 26 | ``` 27 | 28 | You can also specify a custom docker username like so: 29 | 30 | ``` 31 | $ make DOCKER_USER=internavenue 32 | ``` 33 | 34 | ## Container Creation / Running 35 | 36 | The Percona server is configured to store data in `/data` inside the container. 37 | You can map the container's `/data` volume to a volume on the host so the data 38 | becomes independant of the running container. 39 | 40 | This example uses `/srv/docker/lon-dev-db1` to store the Percona data, but you can modify 41 | this to your needs. 42 | 43 | When the container runs, it creates a superuser with a random password. You 44 | can set the username and password for the superuser by setting the container's 45 | environment variables. This lets you discover the username and password of the 46 | superuser from within a linked container or from the output of `docker inspect 47 | percona1`. 48 | 49 | ``` shell 50 | $ mkdir -p /srv/docker/lon-dev-db1 51 | $ docker run -d -name="percona1" \ 52 | -p 127.0.0.1:3306:3306 \ 53 | -v /srv/docker/lon-dev-db1/data:/data \ 54 | -v /srv/docker/lon-dev-db1/run:/run \ 55 | -v /srv/docker/lon-dev-db1/log:/var/log \ 56 | -e USER="super" \ 57 | -e PASS="Whatz03v3r" \ 58 | internavenue/centos-percona 59 | ``` 60 | 61 | Alternately, you can run the following if you have *GNU Make* installed... 62 | 63 | ``` shell 64 | $ make run 65 | ``` 66 | 67 | You can also specify a custom port to bind to on the host, a custom data 68 | directory, and the superuser username and password on the host like so: 69 | 70 | ``` shell 71 | $ sudo mkdir -p /srv/docker/lon-dev-db1 72 | $ make run PORT=127.0.0.1:3306 \ 73 | DATA_DIR=/srv/docker/lon-dev-db1 \ 74 | USER=super \ 75 | PASS=Whatz03v3r 76 | ``` 77 | 78 | ## Connecting to the Database 79 | 80 | To connect to the Percona server, you will need to make sure you have a client. 81 | You can install the `mariadb` (an open-source drop-in replacement for MySQL) on your host machine by running the 82 | following (Fedora 20): 83 | 84 | ``` shell 85 | $ sudo yum install mariadb 86 | ``` 87 | 88 | As part of the startup for Percona Server, the container will set a password for the superuser. 89 | This password could be random, but until the tools have not been developed, it makes tough 90 | to link the container. To view the login in run `docker logs 91 | ` like so: 92 | 93 | ``` shell 94 | $ docker logs percona1 95 | PERCONA_USER=super 96 | PERCONA_PASS=Whatz03v3r 97 | PERCONA_DATA_DIR=/data 98 | Starting Percona MySQL... 99 | 140623 12:31:49 mysqld_safe Logging to '/data/mysql.log'. 100 | 140623 12:31:49 mysqld_safe Starting mysqld daemon with databases from /data 101 | ``` 102 | 103 | Then you can connect to the Percona server from the host with the following 104 | command: 105 | 106 | ``` shell 107 | $ mysql -u super --password=Whatz03v3r --protocol=tcp 108 | ``` 109 | -------------------------------------------------------------------------------- /centos-percona/etc/my.cnf: -------------------------------------------------------------------------------- 1 | [mysql] 2 | port = 3306 3 | socket = /run/mysql.sock 4 | 5 | [mysqld] 6 | 7 | user = mysql 8 | default_storage_engine = InnoDB 9 | secure_auth = 1 10 | skip_show_database = 1 11 | skip_symbolic_links = 1 12 | socket = /run/mysql.sock 13 | pid-file = /run/mysql.pid 14 | 15 | # MyISAM 16 | key_buffer_size = 32M 17 | myisam_recover = FORCE,BACKUP 18 | 19 | # Safety 20 | max_allowed_packet = 16M 21 | max_connect_errors = 1000000 22 | skip_name_resolve 23 | 24 | # Storage 25 | datadir = /data 26 | 27 | # Caches and limits 28 | tmp_table_size = 64M 29 | max_heap_table_size = 64M 30 | query_cache_type = 0 31 | query_cache_size = 0 32 | max_connections = 500 33 | thread_cache_size = 50 34 | open_files_limit = 65535 35 | table_definition_cache = 1024 36 | table_open_cache = 2048 37 | 38 | # InnoDB 39 | innodb_flush_method = O_DIRECT 40 | innodb_log_files_in_group = 2 41 | innodb_log_file_size = 256M 42 | innodb_flush_log_at_trx_commit = 1 43 | innodb_file_per_table = 1 44 | innodb_buffer_pool_size = 6G 45 | 46 | # Replication 47 | log_bin = /var/log/mysql/mysql-bin 48 | expire_logs_days = 4 49 | sync_binlog = 1 50 | max_binlog_size = 100M 51 | 52 | relay_log = /var/log/mysql/mysql-relay.log 53 | 54 | server-id = 1 55 | auto_increment_increment = 2 56 | auto_increment_offset = 1 57 | -------------------------------------------------------------------------------- /centos-percona/etc/percona.init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright Abandoned 1996 TCX DataKonsult AB & Monty Program KB & Detron HB 3 | # This file is public domain and comes with NO WARRANTY of any kind 4 | 5 | # MySQL (Percona Server) daemon start/stop script. 6 | 7 | # Usually this is put in /etc/init.d (at least on machines SYSV R4 based 8 | # systems) and linked to /etc/rc3.d/S99mysql and /etc/rc0.d/K01mysql. 9 | # When this is done the mysql server will be started when the machine is 10 | # started and shut down when the systems goes down. 11 | 12 | # Comments to support chkconfig on RedHat Linux 13 | # chkconfig: 2345 64 36 14 | # description: A very fast and reliable SQL database engine. 15 | 16 | # Comments to support LSB init script conventions 17 | ### BEGIN INIT INFO 18 | # Provides: mysql 19 | # Required-Start: $local_fs $network $remote_fs 20 | # Should-Start: ypbind nscd ldap ntpd xntpd 21 | # Required-Stop: $local_fs $network $remote_fs 22 | # Default-Start: 2 3 4 5 23 | # Default-Stop: 0 1 6 24 | # Short-Description: start and stop MySQL (Percona Server) 25 | # Description: Percona-Server is a SQL database engine with focus on high performance. 26 | ### END INIT INFO 27 | 28 | # If you install MySQL on some other places than /usr, then you 29 | # have to do one of the following things for this script to work: 30 | # 31 | # - Run this script from within the MySQL installation directory 32 | # - Create a /etc/my.cnf file with the following information: 33 | # [mysqld] 34 | # basedir= 35 | # - Add the above to any other configuration file (for example ~/.my.ini) 36 | # and copy my_print_defaults to /usr/bin 37 | # - Add the path to the mysql-installation-directory to the basedir variable 38 | # below. 39 | # 40 | # If you want to affect other MySQL variables, you should make your changes 41 | # in the /etc/my.cnf, ~/.my.cnf or other MySQL configuration files. 42 | 43 | # If you change base dir, you must also change datadir. These may get 44 | # overwritten by settings in the MySQL configuration files. 45 | 46 | basedir= 47 | datadir= 48 | 49 | # Default value, in seconds, afterwhich the script should timeout waiting 50 | # for server start. 51 | # Value here is overriden by value in my.cnf. 52 | # 0 means don't wait at all 53 | # Negative numbers mean to wait indefinitely 54 | service_startup_timeout=900 55 | 56 | # Lock directory for RedHat / SuSE. 57 | lockdir='/var/lock/subsys' 58 | lock_file_path="$lockdir/mysql" 59 | 60 | # The following variables are only set for letting mysql.server find things. 61 | 62 | # Set some defaults 63 | mysqld_pid_file_path= 64 | if test -z "$basedir" 65 | then 66 | basedir=/usr 67 | bindir=/usr/bin 68 | if test -z "$datadir" 69 | then 70 | datadir=/var/lib/mysql 71 | fi 72 | sbindir=/usr/sbin 73 | libexecdir=/usr/sbin 74 | else 75 | bindir="$basedir/bin" 76 | if test -z "$datadir" 77 | then 78 | datadir="$basedir/data" 79 | fi 80 | sbindir="$basedir/sbin" 81 | libexecdir="$basedir/libexec" 82 | fi 83 | 84 | # datadir_set is used to determine if datadir was set (and so should be 85 | # *not* set inside of the --basedir= handler.) 86 | datadir_set= 87 | 88 | # 89 | # Use LSB init script functions for printing messages, if possible 90 | # 91 | lsb_functions="/lib/lsb/init-functions" 92 | if test -f $lsb_functions ; then 93 | . $lsb_functions 94 | else 95 | log_success_msg() 96 | { 97 | echo " SUCCESS! $@" 98 | } 99 | log_failure_msg() 100 | { 101 | echo " ERROR! $@" 102 | } 103 | fi 104 | 105 | PATH="/sbin:/usr/sbin:/bin:/usr/bin:$basedir/bin" 106 | export PATH 107 | 108 | mode=$1 # start or stop 109 | 110 | [ $# -ge 1 ] && shift 111 | 112 | 113 | other_args="$*" # uncommon, but needed when called from an RPM upgrade action 114 | # Expected: "--skip-networking --skip-grant-tables" 115 | # They are not checked here, intentionally, as it is the resposibility 116 | # of the "spec" file author to give correct arguments only. 117 | 118 | case `echo "testing\c"`,`echo -n testing` in 119 | *c*,-n*) echo_n= echo_c= ;; 120 | *c*,*) echo_n=-n echo_c= ;; 121 | *) echo_n= echo_c='\c' ;; 122 | esac 123 | 124 | parse_server_arguments() { 125 | for arg do 126 | case "$arg" in 127 | --basedir=*) basedir=`echo "$arg" | sed -e 's/^[^=]*=//'` 128 | bindir="$basedir/bin" 129 | if test -z "$datadir_set"; then 130 | datadir="$basedir/data" 131 | fi 132 | sbindir="$basedir/sbin" 133 | libexecdir="$basedir/libexec" 134 | ;; 135 | --datadir=*) datadir=`echo "$arg" | sed -e 's/^[^=]*=//'` 136 | datadir_set=1 137 | ;; 138 | --pid-file=*) mysqld_pid_file_path=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; 139 | --service-startup-timeout=*) service_startup_timeout=`echo "$arg" | sed -e 's/^[^=]*=//'` ;; 140 | esac 141 | done 142 | } 143 | 144 | wait_for_pid () { 145 | verb="$1" # created | removed 146 | pid="$2" # process ID of the program operating on the pid-file 147 | pid_file_path="$3" # path to the PID file. 148 | 149 | i=0 150 | avoid_race_condition="by checking again" 151 | 152 | while test $i -ne $service_startup_timeout ; do 153 | 154 | case "$verb" in 155 | 'created') 156 | # wait for a PID-file to pop into existence. 157 | test -s "$pid_file_path" && i='' && break 158 | ;; 159 | 'removed') 160 | # wait for this PID-file to disappear 161 | test ! -s "$pid_file_path" && i='' && break 162 | ;; 163 | *) 164 | echo "wait_for_pid () usage: wait_for_pid created|removed pid pid_file_path" 165 | exit 1 166 | ;; 167 | esac 168 | 169 | # if server isn't running, then pid-file will never be updated 170 | if test -n "$pid"; then 171 | if kill -0 "$pid" 2>/dev/null; then 172 | : # the server still runs 173 | else 174 | # The server may have exited between the last pid-file check and now. 175 | if test -n "$avoid_race_condition"; then 176 | avoid_race_condition="" 177 | continue # Check again. 178 | fi 179 | 180 | # there's nothing that will affect the file. 181 | log_failure_msg "The server quit without updating PID file ($pid_file_path)." 182 | return 1 # not waiting any more. 183 | fi 184 | fi 185 | 186 | echo $echo_n ".$echo_c" 187 | i=`expr $i + 1` 188 | sleep 1 189 | 190 | done 191 | 192 | if test -z "$i" ; then 193 | log_success_msg 194 | return 0 195 | else 196 | log_failure_msg 197 | return 1 198 | fi 199 | } 200 | 201 | # Get arguments from the my.cnf file, 202 | # the only group, which is read from now on is [mysqld] 203 | if test -x ./bin/my_print_defaults 204 | then 205 | print_defaults="./bin/my_print_defaults" 206 | elif test -x $bindir/my_print_defaults 207 | then 208 | print_defaults="$bindir/my_print_defaults" 209 | elif test -x $bindir/mysql_print_defaults 210 | then 211 | print_defaults="$bindir/mysql_print_defaults" 212 | else 213 | # Try to find basedir in /etc/my.cnf 214 | conf=/etc/my.cnf 215 | print_defaults= 216 | if test -r $conf 217 | then 218 | subpat='^[^=]*basedir[^=]*=\(.*\)$' 219 | dirs=`sed -e "/$subpat/!d" -e 's//\1/' $conf` 220 | for d in $dirs 221 | do 222 | d=`echo $d | sed -e 's/[ ]//g'` 223 | if test -x "$d/bin/my_print_defaults" 224 | then 225 | print_defaults="$d/bin/my_print_defaults" 226 | break 227 | fi 228 | if test -x "$d/bin/mysql_print_defaults" 229 | then 230 | print_defaults="$d/bin/mysql_print_defaults" 231 | break 232 | fi 233 | done 234 | fi 235 | 236 | # Hope it's in the PATH ... but I doubt it 237 | test -z "$print_defaults" && print_defaults="my_print_defaults" 238 | fi 239 | 240 | # 241 | # Read defaults file from 'basedir'. If there is no defaults file there 242 | # check if it's in the old (depricated) place (datadir) and read it from there 243 | # 244 | 245 | extra_args="" 246 | if test -r "$basedir/my.cnf" 247 | then 248 | extra_args="-e $basedir/my.cnf" 249 | else 250 | if test -r "$datadir/my.cnf" 251 | then 252 | extra_args="-e $datadir/my.cnf" 253 | fi 254 | fi 255 | 256 | parse_server_arguments `$print_defaults $extra_args mysqld server mysql_server mysql.server` 257 | 258 | # 259 | # Set pid file if not given 260 | # 261 | if test -z "$mysqld_pid_file_path" 262 | then 263 | mysqld_pid_file_path=$datadir/`hostname`.pid 264 | else 265 | case "$mysqld_pid_file_path" in 266 | /* ) ;; 267 | * ) mysqld_pid_file_path="$datadir/$mysqld_pid_file_path" ;; 268 | esac 269 | fi 270 | 271 | case "$mode" in 272 | 'start') 273 | # Start daemon 274 | 275 | # Safeguard (relative paths, core dumps..) 276 | cd $basedir 277 | 278 | echo $echo_n "Starting MySQL (Percona Server)" 279 | if test -x $bindir/mysqld_safe 280 | then 281 | # Give extra arguments to mysqld with the my.cnf file. This script 282 | # may be overwritten at next upgrade. 283 | $bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args 284 | wait_for_pid created "$!" "$mysqld_pid_file_path"; return_value=$? 285 | 286 | # Make lock for RedHat / SuSE 287 | if test -w "$lockdir" 288 | then 289 | touch "$lock_file_path" 290 | fi 291 | 292 | exit $return_value 293 | else 294 | log_failure_msg "Couldn't find MySQL server ($bindir/mysqld_safe)" 295 | fi 296 | ;; 297 | 298 | 'stop') 299 | # Stop daemon. We use a signal here to avoid having to know the 300 | # root password. 301 | 302 | if test -s "$mysqld_pid_file_path" 303 | then 304 | mysqld_pid=`cat "$mysqld_pid_file_path"` 305 | 306 | if (kill -0 $mysqld_pid 2>/dev/null) 307 | then 308 | echo $echo_n "Shutting down MySQL (Percona Server)" 309 | kill $mysqld_pid 310 | # mysqld should remove the pid file when it exits, so wait for it. 311 | wait_for_pid removed "$mysqld_pid" "$mysqld_pid_file_path"; return_value=$? 312 | else 313 | log_failure_msg "MySQL (Percona Server) server process #$mysqld_pid is not running!" 314 | rm "$mysqld_pid_file_path" 315 | fi 316 | 317 | # Delete lock for RedHat / SuSE 318 | if test -f "$lock_file_path" 319 | then 320 | rm -f "$lock_file_path" 321 | fi 322 | exit $return_value 323 | else 324 | log_failure_msg "MySQL (Percona Server) PID file could not be found!" 325 | fi 326 | ;; 327 | 328 | 'restart') 329 | # Stop the service and regardless of whether it was 330 | # running or not, start it again. 331 | if $0 stop $other_args; then 332 | $0 start $other_args 333 | else 334 | log_failure_msg "Failed to stop running server, so refusing to try to start." 335 | exit 1 336 | fi 337 | ;; 338 | 339 | 'reload'|'force-reload') 340 | if test -s "$mysqld_pid_file_path" ; then 341 | read mysqld_pid < "$mysqld_pid_file_path" 342 | kill -HUP $mysqld_pid && log_success_msg "Reloading service MySQL (Percona Server)" 343 | touch "$mysqld_pid_file_path" 344 | else 345 | log_failure_msg "MySQL (Percona Server) PID file could not be found!" 346 | exit 1 347 | fi 348 | ;; 349 | 'status') 350 | # First, check to see if pid file exists 351 | if test -s "$mysqld_pid_file_path" ; then 352 | read mysqld_pid < "$mysqld_pid_file_path" 353 | if kill -0 $mysqld_pid 2>/dev/null ; then 354 | log_success_msg "MySQL (Percona Server) running ($mysqld_pid)" 355 | exit 0 356 | else 357 | log_failure_msg "MySQL (Percona Server) is not running, but PID file exists" 358 | exit 1 359 | fi 360 | else 361 | # Try to find appropriate mysqld process 362 | mysqld_pid=`pidof $libexecdir/mysqld` 363 | 364 | # test if multiple pids exist 365 | pid_count=`echo $mysqld_pid | wc -w` 366 | if test $pid_count -gt 1 ; then 367 | log_failure_msg "Multiple MySQL running but PID file could not be found ($mysqld_pid)" 368 | exit 5 369 | elif test -z $mysqld_pid ; then 370 | if test -f "$lock_file_path" ; then 371 | log_failure_msg "MySQL (Percona Server) is not running, but lock file ($lock_file_path) exists" 372 | exit 2 373 | fi 374 | log_failure_msg "MySQL (Percona Server) is not running" 375 | exit 3 376 | else 377 | log_failure_msg "MySQL (Percona Server) is running but PID file could not be found" 378 | exit 4 379 | fi 380 | fi 381 | ;; 382 | *) 383 | # usage 384 | basename=`basename "$0"` 385 | echo "Usage: $basename {start|stop|restart|reload|force-reload|status} [ MySQL (Percona Server) options ]" 386 | exit 1 387 | ;; 388 | esac 389 | 390 | exit 0 391 | -------------------------------------------------------------------------------- /centos-percona/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | USER=${USER:-super} 2 | PASS=${PASS:-$(pwgen -s -1 16)} 3 | 4 | pre_start_action() { 5 | # Echo out info to later obtain by running `docker logs container_name` 6 | echo "PERCONA_USER=$USER" 7 | echo "PERCONA_PASS=$PASS" 8 | echo "PERCONA_DATA_DIR=$DATA_DIR" 9 | 10 | # Check if the data directory does not exist. 11 | if [ ! -d "$DATA_DIR" ]; then 12 | mkdir -p $DATA_DIR 13 | fi 14 | 15 | # Check if the data directory does not exist. 16 | if [ ! -d "$LOG_DIR/mysql" ]; then 17 | mkdir -p "$LOG_DIR/mysql" 18 | fi 19 | 20 | # test if DATA_DIR has content 21 | if [[ ! "$(ls -A $DATA_DIR)" ]]; then 22 | echo "Initializing PerconaDB at $DATA_DIR" 23 | # Copy the data that we generated within the container to the empty DATA_DIR. 24 | cp -R /var/lib/mysql/* $DATA_DIR 25 | fi 26 | 27 | # Ensure mysql owns the DATA_DIR 28 | chown -R mysql:mysql $DATA_DIR 29 | chown -R mysql:mysql $LOG_DIR 30 | 31 | # Generate SSH-key 32 | /usr/bin/ssh-keygen -A 33 | } 34 | 35 | post_start_action() { 36 | # Create the superuser. 37 | mysql -u root <<-EOF 38 | DELETE FROM mysql.user WHERE user = '$USER'; 39 | FLUSH PRIVILEGES; 40 | CREATE USER '$USER'@'localhost' IDENTIFIED BY '$PASS'; 41 | GRANT ALL PRIVILEGES ON *.* TO '$USER'@'localhost' WITH GRANT OPTION; 42 | CREATE USER '$USER'@'%' IDENTIFIED BY '$PASS'; 43 | GRANT ALL PRIVILEGES ON *.* TO '$USER'@'%' WITH GRANT OPTION; 44 | EOF 45 | 46 | rm /first_run 47 | } 48 | -------------------------------------------------------------------------------- /centos-percona/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | # Cleanup previous sockets 3 | rm -f /data/mysql.sock 4 | } 5 | 6 | post_start_action() { 7 | : # No-op 8 | } 9 | -------------------------------------------------------------------------------- /centos-percona/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up PerconaDB within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | DATA_DIR=/data 8 | LOG_DIR=/var/log 9 | 10 | if [[ -e /first_run ]]; then 11 | source /scripts/first_run.sh 12 | else 13 | source /scripts/normal_run.sh 14 | fi 15 | 16 | wait_for_mysql_and_run_post_start_action() { 17 | # Wait for mysql to finish starting up first. 18 | while [[ ! -e ${DATA_DIR}/mysql.sock ]] ; do 19 | inotifywait -q -e create ${DATA_DIR} >> /dev/null 20 | done 21 | 22 | post_start_action 23 | } 24 | 25 | pre_start_action 26 | 27 | wait_for_mysql_and_run_post_start_action & 28 | 29 | echo "Starting Syslog-ng..." 30 | syslog-ng --no-caps 31 | 32 | echo "Starting SSHd..." 33 | /usr/sbin/sshd 34 | 35 | echo "Starting Percona MySQL..." 36 | exec /etc/init.d/mysqld start 37 | -------------------------------------------------------------------------------- /centos-phabricator/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-php:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | # Install git to download Phabricator. 6 | RUN \ 7 | yum -y install \ 8 | git \ 9 | python-pygments \ 10 | ctags \ 11 | && \ 12 | yum clean all 13 | 14 | # Download Phabricator bundle. 15 | RUN \ 16 | mkdir -p /srv/www/phabricator && \ 17 | mkdir -p /srv/git/ 18 | 19 | ADD scripts /scripts 20 | RUN chmod +x /scripts/start.sh 21 | RUN touch /first_run 22 | 23 | # Expose our web root and log directories log. 24 | VOLUME ["/srv/www/phabricator", "/srv/git", "/var/log", "/run", "/vagrant"] 25 | 26 | EXPOSE 9000 22 27 | 28 | # Kicking in 29 | CMD ["/scripts/start.sh"] 30 | 31 | -------------------------------------------------------------------------------- /centos-phabricator/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own Docker index username, if you like. 2 | # Database-related variables. 3 | DB_DOCKER_USER=internavenue 4 | DB_DOCKER_REPO_NAME=centos-percona:centos7 5 | DB_CONTAINER_NAME:=lon-dev-db1 6 | 7 | # Change this to suit your needs. 8 | DB_USER:=super 9 | DB_PASS:=Whatz03v3r 10 | 11 | DB_PORT:=127.0.0.1:3306 12 | DB_SSH_PORT:=127.0.0.1:2222 13 | 14 | # These directories will be mounted in the containers. 15 | DB_DATA_DIR:=/srv/docker/$(DB_CONTAINER_NAME)/mysql 16 | DB_LOGS_DIR:=/srv/docker/$(DB_CONTAINER_NAME)/log 17 | DB_RUN_DIR:=/srv/docker/$(DB_CONTAINER_NAME)/run 18 | 19 | DB_RUNNING:=$(shell docker ps | grep "$(DB_CONTAINER_NAME) "| cut -f 1 -d ' ') 20 | DB_ALL:=$(shell docker ps -a | grep "$(DB_CONTAINER_NAME) " | cut -f 1 -d ' ') 21 | 22 | DB_DOCKER_RUN_COMMON=--name="$(DB_CONTAINER_NAME)" \ 23 | -p $(DB_PORT):3306 \ 24 | -p $(DB_SSH_PORT):22 \ 25 | -v $(DB_DATA_DIR):/data \ 26 | -v $(DB_RUN_DIR):/run \ 27 | -v $(DB_LOGS_DIR):/var/log \ 28 | -e USER="$(DB_USER)" -e PASS="$(DB_PASS)" $(DB_DOCKER_USER)/$(DB_DOCKER_REPO_NAME) 29 | 30 | 31 | # Phabricator-related variables. 32 | 33 | PH_DOCKER_USER=internavenue 34 | PH_DOCKER_REPO_NAME=centos-phabricator:centos7 35 | 36 | PH_PORT:=127.0.0.1:80 37 | 38 | PH_DATA_DIR:=/srv/docker/$(PH_CONTAINER_NAME)/www 39 | PH_REPO_DIR:=/srv/docker/$(PH_CONTAINER_NAME)/git 40 | PH_LOGS_DIR:=/srv/docker/$(PH_CONTAINER_NAME)/log 41 | PH_RUN_DIR:=/srv/docker/$(PH_CONTAINER_NAME)/run 42 | 43 | PH_CONTAINER_NAME:=lon-dev-ph 44 | 45 | PH_RUNNING:=$(shell docker ps | grep "$(PH_CONTAINER_NAME) " | cut -f 1 -d ' ') 46 | PH_ALL:=$(shell docker ps -a | grep "$(PH_CONTAINER_NAME) " | cut -f 1 -d ' ') 47 | 48 | PH_DOCKER_RUN_COMMON=--name="$(PH_CONTAINER_NAME)" -p $(PH_PORT):80 \ 49 | -v $(PH_DATA_DIR):/srv/www/phabricator \ 50 | -v $(PH_REPO_DIR):/srv/git \ 51 | -v $(PH_LOGS_DIR):/var/log \ 52 | -v $(PH_RUN_DIR):/var/log \ 53 | --link $(DB_CONTAINER_NAME):mysql $(PH_DOCKER_USER)/$(PH_DOCKER_REPO_NAME) 54 | 55 | 56 | all: build 57 | 58 | ph_dir: 59 | mkdir -p $(PH_DATA_DIR) 60 | mkdir -p $(PH_REPO_DIR) 61 | mkdir -p $(PH_LOGS_DIR) 62 | 63 | db_dir: 64 | mkdir -p $(DB_DATA_DIR) 65 | mkdir -p $(DB_RUN_DIR) 66 | mkdir -p $(DB_LOG_DIR) 67 | 68 | clean: db_clean ph_clean 69 | 70 | build: 71 | docker build -t="$(PH_DOCKER_USER)/$(PH_DOCKER_REPO_NAME)" . 72 | 73 | ph_run: ph_clean ph_dir 74 | docker run -d $(PH_DOCKER_RUN_COMMON) 75 | 76 | db_bash: clean 77 | mkdir -p $(DB_DATA_DIR) 78 | docker run -t -i $(DB_DOCKER_RUN_COMMON) /bin/bash 79 | 80 | db_run: db_clean 81 | docker run -d $(DB_DOCKER_RUN_COMMON) 82 | # FIXME: at this stage we don't know that the access has been granted. 83 | sleep 5 84 | 85 | run: db_run ph_run 86 | 87 | bash: ph_clean db_clean db_run ph_dir 88 | docker run -t -i $(PH_DOCKER_RUN_COMMON) /bin/bash 89 | 90 | PH_RUNNING:=$(shell docker ps | grep "$(PH_CONTAINER_NAME) " | cut -f 1 -d ' ') 91 | PH_ALL:=$(shell docker ps -a | grep "$(PH_CONTAINER_NAME) " | cut -f 1 -d ' ') 92 | 93 | db_clean: 94 | ifneq ($(strip $(DB_RUNNING)),) 95 | docker stop $(DB_RUNNING) 96 | endif 97 | ifneq ($(strip $(DB_ALL)),) 98 | docker rm $(DB_ALL) 99 | endif 100 | 101 | ph_clean: 102 | ifneq ($(strip $(PH_RUNNING)),) 103 | docker stop $(PH_RUNNING) 104 | endif 105 | ifneq ($(strip $(PH_ALL)),) 106 | docker rm $(PH_ALL) 107 | endif 108 | 109 | # Destroys the data directory. 110 | ph_deepclean: ph_clean 111 | sudo rm -rf $(PH_DATA_DIR) 112 | sudo rm -rf $(PH_REPO_DIR) 113 | sudo rm -rf $(PH_LOGS_DIR) 114 | 115 | -------------------------------------------------------------------------------- /centos-phabricator/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-phabricator 2 | 3 | A Dockerfile that produces a CentOS-based Docker image that will run the latest stable [Phabricator bundle][phabricator]. 4 | 5 | The build is based on [internavenue/docker-centos-base][docker-centos-base]. 6 | 7 | [phabricator]: http://phabricator.org/ 8 | [docker-centos-base]: https://github.com/internavenue/docker-centos-base 9 | 10 | ## Included packages (and their dependencies) 11 | 12 | * [internavenue/centos-base][centos-base] 13 | * Phabricator (Phabricator, Arcanist, libphutil) 14 | * Git 15 | 16 | The example Makefile requires a container with [internavenue/docker-centos-percona][centos-percona] image. 17 | 18 | [centos-base]: https://github.com/internavenue/docker-centos-base 19 | [centos-percona]: https://github.com/internavenue/docker-centos-percona 20 | 21 | ## README.first 22 | 23 | Unlike other Phabricator images, this one does not contain database server. This can be 24 | quite handy for real world scenarios, where you MySQL server is multitenant. 25 | 26 | The database server can be an other linked container such as [internavenue/docker-centos-percona][centos-percona] or 27 | a standalone MySQL somewhere. In the later case the following variables needs to be passed to the container: 28 | 29 | * `MYSQL_PORT_3306_TCP_ADDR` 30 | * `MYSQL_PORT_3306_TCP_PORT` 31 | * `MYSQL_ENV_USER` 32 | * `MYSQL_ENV_PASS` 33 | 34 | [centos-percona]: https://github.com/internavenue/docker-centos-percona 35 | 36 | ## Image Creation 37 | 38 | This example creates the image with the tag `internavenue/centos-phabricator`, but you can 39 | change this to use your own username. 40 | 41 | 42 | ``` 43 | $ docker build -t="internavenue/centos-phabricator" . 44 | ``` 45 | 46 | Alternately, you can run the following if you have *GNU Make* installed... 47 | 48 | ``` 49 | $ make 50 | ``` 51 | 52 | You can also specify a custom docker username like so: 53 | 54 | ``` 55 | $ make DOCKER_USER=internavenue 56 | ``` 57 | 58 | ## Container Creation / Running 59 | 60 | Phabricator's web root is `/srv/www/phabricator` inside the container. 61 | You can map the container's `/srv/www/phabricatr` volume to a volume on the host so the data 62 | becomes independant of the running container. 63 | 64 | This example uses `/srv/docker/lon-dev-ph` to host the web application, but you can modify 65 | this to your needs. 66 | 67 | When the container runs, it creates a superuser with a random password. You 68 | can set the username and password for the superuser by setting the container's 69 | environment variables. This lets you discover the username and password of the 70 | superuser from within a linked container or from the output of `docker inspect 71 | web1`. 72 | 73 | ``` shell 74 | $ mkdir -p /srv/docker/lon-dev-ph 75 | $ docker run -d -name="ph" \ 76 | -p 127.0.0.1:80:80 \ 77 | -v /srv/docker/lon-dev-ph:/srv/www/phabricator \ 78 | -e USER="super" \ 79 | -e PASS="Whatz03v3r" \ 80 | internavenue/centos-pabricator 81 | ``` 82 | 83 | Alternately, you can run the following if you have *GNU Make* installed... 84 | 85 | ``` shell 86 | $ make run 87 | ``` 88 | 89 | You can also specify a custom port to bind to on the host, a custom web root 90 | directory, and the superuser username and password on the host like so: 91 | 92 | ``` shell 93 | $ sudo mkdir -p /srv/docker/lon-dev-ph 94 | $ make run PH_PORT=127.0.0.1:80 \ 95 | PH_DATA_DIR=/my/spec/data/dir \ 96 | PH_LOG_DIR=/my/spec/log/dir \ 97 | DB_DATA_DIR=/my/db/data/dir \ 98 | DB_LOG_DIR=/my/db/log/dir \ 99 | DB_USER=super \ 100 | DB_PASS=Whatz03v3r 101 | ``` 102 | -------------------------------------------------------------------------------- /centos-phabricator/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | mkdir -p $DATA_DIR 3 | mkdir -p "$LOG_DIR/nginx" 4 | 5 | cd $DATA_DIR 6 | 7 | if [ ! -d libphutil ]; then 8 | echo "Cloning libphutil..." 9 | git clone https://github.com/facebook/libphutil.git 10 | else 11 | echo "The directory of libphutil is not empty. Left as is." 12 | fi 13 | 14 | if [ ! -d arcanist ]; then 15 | echo "Cloning Arcanist..." 16 | git clone https://github.com/facebook/arcanist.git 17 | else 18 | echo "The directory of Arcanist is not empty. Left as is." 19 | fi 20 | 21 | if [ ! -d phabricator ]; then 22 | echo "Cloning Phabricator..." 23 | git clone https://github.com/facebook/phabricator.git 24 | else 25 | echo "The directory of Phabricator is not empty. Left as is." 26 | fi 27 | 28 | if [ ! -d libext/sprint ]; then 29 | echo "Cloning Mediawiki Sprint extension" 30 | git clone https://github.com/wikimedia/phabricator-extensions-Sprint.git 31 | mkdir -p libext 32 | mv phabricator-extensions-Sprint libext/sprint 33 | fi 34 | 35 | cd phabricator 36 | bin/config set mysql.host $MYSQL_PORT_3306_TCP_ADDR 37 | bin/config set mysql.port $MYSQL_PORT_3306_TCP_PORT 38 | bin/config set mysql.user $MYSQL_ENV_USER 39 | bin/config set mysql.pass $MYSQL_ENV_PASS 40 | bin/config set load-libraries: '{"sprint":"/srv/www/phabricator/libext/sprint/src"}' 41 | bin/config set pygments.enabled true 42 | bin/storage upgrade --force 43 | bin/phd start 44 | 45 | chown -R nginx:nginx $DATA_DIR 46 | chown -R nginx:nginx "$LOG_DIR/nginx" 47 | 48 | mkdir -p /var/log/php-fpm 49 | } 50 | 51 | post_start_action() { 52 | rm /first_run 53 | } 54 | -------------------------------------------------------------------------------- /centos-phabricator/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | # Cleanup previous sockets 3 | rm -f /data/mysql.sock 4 | 5 | cd /srv/www/phabricator/phabricator 6 | bin/config set mysql.host $MYSQL_PORT_3306_TCP_ADDR 7 | bin/config set mysql.port $MYSQL_PORT_3306_TCP_PORT 8 | bin/config set mysql.user $MYSQL_ENV_DB_USER 9 | bin/config set mysql.pass $MYSQL_ENV_DB_PASS 10 | } 11 | 12 | post_start_action() { 13 | : # No-op 14 | } 15 | -------------------------------------------------------------------------------- /centos-phabricator/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up the Phabricator stack within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | DATA_DIR=/srv/www/phabricator 8 | LOG_DIR=/var/log 9 | 10 | SESSION_DIR=/var/lib/php/session 11 | LOG_DIR=/var/log/php-fpm 12 | WSDL_CACHE_DIR=/var/lib/php/wsdlcache 13 | LOCK_DIR=/var/run/lock/subsys 14 | 15 | # The main user for PHP-FPM. 16 | PHP_USER=apache 17 | PHP_GROUP=apache 18 | 19 | if [[ -e /first_run ]]; then 20 | source /scripts/first_run.sh 21 | else 22 | source /scripts/normal_run.sh 23 | fi 24 | 25 | pre_start_action 26 | post_start_action 27 | 28 | chown -R $PHP_USER:$PHP_GROUP $SESSION_DIR 29 | chown -R $PHP_USER:$PHP_GROUP $WSDL_CACHE_DIR 30 | chown -R $PHP_USER:$PHP_GROUP $LOG_DIR 31 | chown -R $PHP_USER:$PHP_GROUP $LOCK_DIR 32 | 33 | echo "Starting Syslog-ng..." 34 | syslog-ng --no-caps 35 | 36 | echo "Starting SSHd..." 37 | /usr/sbin/sshd 38 | 39 | echo "Starting PHP..." 40 | exec /etc/init.d/php-fpm start 41 | -------------------------------------------------------------------------------- /centos-php/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | # Install Remi Collet's repo for CentOS 7 6 | RUN yum -y install \ 7 | http://rpms.famillecollet.com/enterprise/remi-release-7.rpm \ 8 | http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm 9 | 10 | # Install PHP and Percona (MySQL) client stuff and the latest stable PHP. 11 | RUN yum -y install --enablerepo=remi,remi-php56 \ 12 | Percona-Server-client-56 \ 13 | php-cli \ 14 | php-fpm \ 15 | php-gd \ 16 | php-mbstring \ 17 | php-mcrypt \ 18 | php-mysqlnd \ 19 | php-opcache \ 20 | php-pdo \ 21 | php-pear \ 22 | php-soap \ 23 | php-xml \ 24 | php-pecl-imagick \ 25 | php-pecl-apcu 26 | 27 | # Clean up YUM when done. 28 | RUN yum clean all 29 | 30 | ADD scripts /scripts 31 | RUN chmod +x /scripts/start.sh 32 | RUN touch /first_run 33 | 34 | RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php.ini 35 | ADD etc/fastcgi_params.conf /etc/nginx/conf/fastcgi_params.conf 36 | RUN mv /etc/php-fpm.d/www.conf /etc/php-fpm.d/www.conf.default 37 | ADD etc/www.conf /etc/php-fpm.d/www.conf 38 | 39 | # Add Composer 40 | RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer && chmod +x /usr/local/bin/composer 41 | 42 | ADD scripts /scripts 43 | RUN chmod +x /scripts/start.sh 44 | 45 | # Expose our web root and log directories log. 46 | VOLUME ["/srv/www", "/var/log", "/var/lib/php", "/run", "/vagrant"] 47 | 48 | EXPOSE 9000 22 49 | 50 | # Kicking in 51 | CMD ["/scripts/start.sh"] 52 | 53 | -------------------------------------------------------------------------------- /centos-php/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-php:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-php1 7 | DATA_DIR:=/srv/docker/lon-dev-php1/www 8 | RUN_DIR:=/srv/docker/lon-dev-php1/run 9 | LOG_DIR:=/srv/docker/lon-dev-php1/log 10 | PORT:=127.0.0.1:9000 11 | 12 | RUNNING:=$(shell docker ps | grep $(CONTAINER_NAME) | cut -f 1 -d ' ') 13 | ALL:=$(shell docker ps -a | grep $(CONTAINER_NAME) | cut -f 1 -d ' ') 14 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" \ 15 | --privileged \ 16 | -p $(PORT):9000 \ 17 | -v $(DATA_DIR):/srv/www \ 18 | -v $(LOG_DIR):/var/log \ 19 | -v $(RUN_DIR):/run \ 20 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 21 | 22 | all: build 23 | 24 | dir: 25 | mkdir -p $(DATA_DIR) 26 | mkdir -p $(LOG_DIR) 27 | mkdir -p $(RUN_DIR) 28 | 29 | build: 30 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 31 | 32 | run: clean dir 33 | docker run -d $(DOCKER_RUN_COMMON) 34 | 35 | bash: clean dir 36 | docker run -t -i $(DOCKER_RUN_COMMON) /bin/bash 37 | 38 | # Removes existing containers. 39 | clean: 40 | ifneq ($(strip $(RUNNING)),) 41 | docker stop $(RUNNING) 42 | endif 43 | ifneq ($(strip $(ALL)),) 44 | docker rm $(ALL) 45 | endif 46 | 47 | # Destroys the data directory. 48 | deepclean: clean 49 | sudo rm -rf $(DATA_DIR) 50 | sudo rm -rf $(RUN_DIR) 51 | sudo rm -rf $(LOG_DIR) 52 | 53 | -------------------------------------------------------------------------------- /centos-php/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-php 2 | 3 | A Docker build that produces a CentOS-based Docker image that will run the latest stable PHP. 4 | 5 | The build is based on [internavenue/docker-centos-base][docker-centos-base] 6 | 7 | [docker-centos-base]: https://github.com/internavenue/dockerfiles/tree/master/centos-base 8 | 9 | ## Included packages (and their dependencies) 10 | 11 | The PHP packages are pulled from [Remi Collet][remi]'s excellent RPM repo. 12 | 13 | * PHP 5.6.x and its extensions: php-gd, php-ldap, php-mbstring, php-mcrypt, php-mysqlnd, php-pdo, php-pear, php-pecl-apc, php-pecl-imagick, php-soap, php-xml 14 | * PHP-FPM 15 | * Percona 5.6 client which provides libmysqlclient, a dependency for php-mysqlnd and php-pdo. This is simple matter of taste, the CentOS default MariaDB client could be also fine, but our other MySQL-ish Docker build, the [internavenue/docker-centos-percona][docker-centos-percona] is based on Percona, we wanted to be consistent here. 16 | * Composer 17 | * [Puppet][puppet] 18 | * [tmux][tmux] 19 | * Screen 20 | * VIM (Enhanced) 21 | * Midnight Commander 22 | * OpenSSH client and server 23 | * PWgen 24 | 25 | [puppet]: http://puppetlabs.com/puppet 26 | [tmux]: http://en.wikipedia.org/wiki/Tmux 27 | [remi]: http://rpms.famillecollet.com/ 28 | 29 | ## Image Creation 30 | 31 | This example creates the image with the tag `internavenue/centos-php`, but you can 32 | change this to use your own username. 33 | 34 | 35 | ``` 36 | $ docker build -t="internavenue/centos-php" . 37 | ``` 38 | 39 | Alternately, you can run the following if you have *GNU Make* installed... 40 | 41 | ``` 42 | $ make 43 | ``` 44 | 45 | You can also specify a custom docker username like so: 46 | 47 | ``` 48 | $ make DOCKER_USER=internavenue 49 | ``` 50 | 51 | ## Container Creation / Running 52 | 53 | The Nginx web server is configured to store web root in `/srv/www` inside the container. 54 | You can map the container's `/srv/www` volume to a volume on the host so the data 55 | becomes independant of the running container. 56 | 57 | This example uses `/srv/docker/lon-dev-web` to host the web application, but you can modify 58 | this to your needs. 59 | 60 | When the container runs, it creates a superuser with a random password. You 61 | can set the username and password for the superuser by setting the container's 62 | environment variables. This lets you discover the username and password of the 63 | superuser from within a linked container or from the output of `docker inspect 64 | web1`. 65 | 66 | ``` shell 67 | $ mkdir -p /srv/docker/lon-dev-web 68 | $ docker run -d -name="web1" \ 69 | -p 127.0.0.1:80:80 \ 70 | -v /srv/docker/lon-dev-web:/srv/www \ 71 | -e USER="super" \ 72 | -e PASS="Whatz03v3r" \ 73 | internavenue/nginx 74 | ``` 75 | 76 | Alternately, you can run the following if you have *GNU Make* installed... 77 | 78 | ``` shell 79 | $ make run 80 | ``` 81 | 82 | You can also specify a custom port to bind to on the host, a custom web root 83 | directory, and the superuser username and password on the host like so: 84 | 85 | ``` shell 86 | $ sudo mkdir -p /srv/docker/lon-dev-web 87 | $ make run PORT=127.0.0.1:8080 \ 88 | DATA_DIR=/my/spec/data/dir \ 89 | USER=super \ 90 | PASS=Whatz03v3r 91 | ``` 92 | 93 | -------------------------------------------------------------------------------- /centos-php/etc/fastcgi_params.conf: -------------------------------------------------------------------------------- 1 | fastcgi_pass unix:/var/run/php-fpm/www.sock; 2 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 3 | fastcgi_index index.php; 4 | 5 | # Required if PHP was built with --enable-force-cgi-redirect. 6 | fastcgi_param REDIRECT_STATUS 200; 7 | 8 | # Variables to make the $_SERVER populate in PHP. 9 | fastcgi_param CONTENT_TYPE $content_type; 10 | fastcgi_param CONTENT_LENGTH $content_length; 11 | fastcgi_param DOCUMENT_URI $document_uri; 12 | fastcgi_param DOCUMENT_ROOT $document_root; 13 | fastcgi_param GATEWAY_INTERFACE CGI/1.1; 14 | fastcgi_param HTTPS $https if_not_empty; 15 | fastcgi_param QUERY_STRING $query_string; 16 | fastcgi_param REMOTE_ADDR $remote_addr; 17 | fastcgi_param REMOTE_PORT $remote_port; 18 | fastcgi_param REQUEST_METHOD $request_method; 19 | fastcgi_param REQUEST_URI $request_uri; 20 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 21 | fastcgi_param SCRIPT_NAME $fastcgi_script_name; 22 | fastcgi_param SERVER_ADDR $server_addr; 23 | fastcgi_param SERVER_PORT $server_port; 24 | fastcgi_param SERVER_NAME $server_name; 25 | fastcgi_param SERVER_PROTOCOL $server_protocol; 26 | fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; 27 | -------------------------------------------------------------------------------- /centos-php/etc/www.conf: -------------------------------------------------------------------------------- 1 | [www] 2 | ; Unix socket details 3 | listen = /var/run/php-fpm/www.sock 4 | listen.allowed_clients = 127.0.0.1 5 | listen.owner = apache 6 | listen.group = apache 7 | listen.mode = 0660 8 | 9 | ; Unix user/group of processes 10 | user = apache 11 | group = apache 12 | 13 | pm = dynamic 14 | pm.max_children = 50 15 | pm.start_servers = 5 16 | pm.min_spare_servers = 5 17 | pm.max_spare_servers = 35 18 | pm.status_path = /status 19 | ping.path = /ping 20 | ping.response = pong 21 | request_slowlog_timeout = 8s 22 | slowlog = /var/log/php-fpm/www-slow.log 23 | 24 | ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com 25 | ;php_flag[display_errors] = off 26 | php_admin_value[error_log] = /var/log/php-fpm/www-error.log 27 | php_admin_flag[log_errors] = on 28 | php_admin_value[memory_limit] = 128M 29 | 30 | ; Set session path to a directory owned by process user 31 | php_value[session.save_handler] = files 32 | php_value[session.save_path] = /var/lib/php/session 33 | php_value[soap.wsdl_cache_dir] = /var/lib/php/wsdlcache 34 | 35 | -------------------------------------------------------------------------------- /centos-php/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up PHP-FPM within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | SESSION_DIR=/var/lib/php/session 8 | LOG_DIR=/var/log/php-fpm 9 | WSDL_CACHE_DIR=/var/lib/php/wsdlcache 10 | LOCK_DIR=/var/run/lock/subsys 11 | 12 | # The main user for PHP-FPM. 13 | PHP_USER=apache 14 | PHP_GROUP=apache 15 | 16 | if [[ -e /first_run ]]; then 17 | source /scripts/first_run.sh 18 | else 19 | source /scripts/normal_run.sh 20 | fi 21 | 22 | pre_start_action 23 | post_start_action 24 | 25 | chown -R $PHP_USER:$PHP_GROUP $SESSION_DIR 26 | chown -R $PHP_USER:$PHP_GROUP $WSDL_CACHE_DIR 27 | chown -R $PHP_USER:$PHP_GROUP $LOG_DIR 28 | chown -R $PHP_USER:$PHP_GROUP $LOCK_DIR 29 | 30 | echo "Starting Syslog-ng..." 31 | syslog-ng --no-caps 32 | 33 | echo "Starting SSHd..." 34 | /usr/sbin/sshd 35 | 36 | echo "Starting PHP-FPM..." 37 | /etc/init.d/php-fpm start 38 | 39 | -------------------------------------------------------------------------------- /centos-predictionio/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | ENV PIO_VERSION 0.9.5 6 | 7 | RUN yum install -y \ 8 | bzip2 \ 9 | git \ 10 | java-1.8.0-openjdk \ 11 | java-1.8.0-openjdk-devel \ 12 | python-setuptools python-dev python-numpy \ 13 | install mysql-connector-python \ 14 | easy_install predictionio \ 15 | tar \ 16 | unzip \ 17 | && \ 18 | yum clean all 19 | 20 | #WORKDIR / 21 | 22 | #RUN curl https://d8k1yxp8elc6b.cloudfront.net/PredictionIO-$PIO_VERSION.tar.gz | tar xvz 23 | 24 | #RUN mkdir -p /PredictionIO-$PIO_VERSION/vendors 25 | 26 | #WORKDIR PredictionIO-$PIO_VERSION/vendors 27 | 28 | #RUN curl https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz | tar xvz 29 | 30 | #RUN curl http://archive.apache.org/dist/hbase/hbase-1.0.0/hbase-1.0.0-bin.tar.gz | tar xvz 31 | 32 | RUN echo "export PATH=$PATH:/vagrant/PredictionIO/bin" >> ~/.bashrc 33 | RUN source ~/.bashrc 34 | 35 | WORKDIR /vagrant 36 | -------------------------------------------------------------------------------- /centos-predictionio/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-predictionio 2 | 3 | A Dockerfile that produces a Centos-based Docker image that will prepare the dependencies needed to run [Prediction.io][predictionio]. 4 | 5 | [predictionio]: https://prediction.io/ 6 | 7 | 8 | ## Image Creation 9 | 10 | This example creates the image with the tag `internavenue/centos-predictionio`, but you can change this to use your own username. 11 | 12 | 13 | ``` 14 | sudo docker build -t="internavenue/centos-predictionio" . 15 | ``` 16 | 17 | You can also specify a custom docker username like so: 18 | 19 | ``` 20 | make DOCKER_USER=internavenue 21 | ``` 22 | 23 | 24 | ## Usage 25 | 26 | Predictionio needs to connect to port 8000 to serve predictions and its event server needs to have 7070 exposed, therefore it is suggested to map the default internal ports to the same ones in the host 27 | 28 | ``` 29 | sudo docker run -t -i -v /vagrant:/vagrant -p 7070:7070 -p 8000:8000 internavenue/centos-predictionio:centos7 30 | ``` 31 | -------------------------------------------------------------------------------- /centos-sonarqube/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | MAINTAINER Intern Avenue Dev Team 3 | 4 | RUN wget -O /etc/yum.repos.d/sonar.repo http://downloads.sourceforge.net/project/sonar-pkg/rpm/sonar.repo 5 | 6 | RUN yum -y install \ 7 | java-1.7.0-openjdk \ 8 | yum install sonar 9 | 10 | # Clean up YUM when done. 11 | RUN yum clean all 12 | 13 | ADD scripts /scripts 14 | RUN chmod +x /scripts/start.sh 15 | RUN touch /first_run 16 | 17 | # The --deaemon removed from the init file. 18 | #ADD etc/jenkins /etc/init.d/jenkins 19 | #RUN chmod +x /etc/init.d/jenkins 20 | 21 | EXPOSE 8080 22 22 | 23 | # Expose our web root and log directories log. 24 | VOLUME ["/opt/sonar", "/var/log"] 25 | 26 | # Kicking in 27 | CMD ["/scripts/start.sh"] 28 | 29 | -------------------------------------------------------------------------------- /centos-sonarqube/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own Docker index username, if you like. 2 | # Database-related variables. 3 | DB_DOCKER_USER=internavenue 4 | DB_DOCKER_REPO_NAME=centos-percona 5 | DB_CONTAINER_NAME:=lon-dev-db1 6 | 7 | # Change this to suit your needs. 8 | DB_USER:=super 9 | DB_PASS:=Whatz03v3r 10 | 11 | DB_PORT:=127.0.0.1:3306 12 | DB_SSH_PORT:=127.0.0.1:2222 13 | 14 | # These directories will be mounted in the containers. 15 | DB_DATA_DIR:=/srv/docker/lon-dev-db1/mysql 16 | DB_LOGS_DIR:=/srv/docker/lon-dev-db1/log 17 | 18 | DB_RUNNING:=$(shell docker ps | grep "$(DB_CONTAINER_NAME) "| cut -f 1 -d ' ') 19 | DB_ALL:=$(shell docker ps -a | grep "$(DB_CONTAINER_NAME) " | cut -f 1 -d ' ') 20 | 21 | DB_DOCKER_RUN_COMMON=--name="$(DB_CONTAINER_NAME)" -p $(DB_PORT):3306 -p $(DB_SSH_PORT):22 \ 22 | -v $(DB_DATA_DIR):/data \ 23 | -v $(DB_LOGS_DIR):/var/log \ 24 | -e USER="$(DB_USER)" -e PASS="$(DB_PASS)" $(DB_DOCKER_USER)/$(DB_DOCKER_REPO_NAME) 25 | 26 | 27 | # SonarQube build part 28 | 29 | # Substitute your own docker index username, if you like. 30 | SQ_DOCKER_USER=internavenue 31 | SQ_DOCKER_REPO_NAME=centos-sonarqube 32 | 33 | # Change this to suit your needs. 34 | SQ_CONTAINER_NAME:=lon-dev-sonar1 35 | SQ_LOG_DIR:=/srv/docker/lon-dev-sonar1/log 36 | SQ_DATA_DIR:=/srv/docker/lon-dev-sonar1/data 37 | 38 | SQ_RUNNING:=$(shell docker ps | grep "$(SQ_CONTAINER_NAME) " | cut -f 1 -d ' ') 39 | SQ_ALL:=$(shell docker ps -a | grep "$(SQ_CONTAINER_NAME) " | cut -f 1 -d ' ') 40 | 41 | # Because of a bug, the container has to run as privileged, 42 | # otherwise you end up with "could not open session" error. 43 | SQ_DOCKER_RUN_COMMON=--name="$(SQ_CONTAINER_NAME)" \ 44 | -P \ 45 | -v $(SQ_LOG_DIR):/var/log \ 46 | -v $(SQ_DATA_DIR):/opt/sonar \ 47 | $(SQ_DOCKER_USER)/$(SQ_DOCKER_REPO_NAME) 48 | 49 | all: build 50 | 51 | dir: 52 | mkdir -p $(SQ_LOG_DIR) 53 | mkdir -p $(SQ_DATA_DIR) 54 | 55 | build: 56 | docker build -t="$(SQ_DOCKER_USER)/$(SQ_DOCKER_REPO_NAME)" . 57 | 58 | sq_run: sq_clean dir 59 | docker run -d $(SQ_DOCKER_RUN_COMMON) 60 | 61 | sq_bash: sq_clean dir 62 | docker run --privileged -t -i $(SQ_DOCKER_RUN_COMMON) /bin/bash 63 | 64 | # Removes existing containers. 65 | sq_clean: 66 | ifneq ($(strip $(SQ_RUNNING)),) 67 | docker stop $(SQ_RUNNING) 68 | endif 69 | ifneq ($(strip $(SQ_ALL)),) 70 | docker rm $(SQ_ALL) 71 | endif 72 | 73 | # Deletes the directories. 74 | deepclean: clean 75 | sudo rm -rf $(SQ_LOG_DIR) 76 | sudo rm -rf $(SQ_DATA_DIR) 77 | -------------------------------------------------------------------------------- /centos-sonarqube/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | # mkdir -p $LIB_DIR 3 | # mkdir -p $CACHE_DIR 4 | # mkdir -p "$LOG_DIR/jenkins" 5 | /usr/bin/ssh-keygen -A 6 | } 7 | 8 | post_start_action() { 9 | rm /first_run 10 | } 11 | -------------------------------------------------------------------------------- /centos-sonarqube/scripts/normal_run.sh: -------------------------------------------------------------------------------- 1 | pre_start_action() { 2 | : # No-op 3 | } 4 | 5 | post_start_action() { 6 | : # No-op 7 | } 8 | -------------------------------------------------------------------------------- /centos-sonarqube/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Starts up SonarQube within the container. 3 | 4 | # Stop on error 5 | set -e 6 | 7 | LIB_DIR=/var/lib/jenkins 8 | LOG_DIR=/var/log 9 | CACHE_DIR=/var/cache/jenkins/war 10 | 11 | if [[ -e /first_run ]]; then 12 | source /scripts/first_run.sh 13 | else 14 | source /scripts/normal_run.sh 15 | fi 16 | 17 | pre_start_action 18 | post_start_action 19 | 20 | chown -R jenkins:jenkins $LIB_DIR 21 | chown -R jenkins:jenkins $CACHE_DIR 22 | chown -R jenkins:jenkins "$LOG_DIR/jenkins" 23 | 24 | echo "Starting Syslog-ng..." 25 | syslog-ng --no-caps 26 | 27 | echo "Starting SSHd..." 28 | /usr/sbin/sshd 29 | 30 | echo "Starting Jenkins..." 31 | /etc/init.d/jenkins start 32 | -------------------------------------------------------------------------------- /centos-spark/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | # SPARK 6 | ENV SPARK_PROFILE 1.3 7 | ENV SPARK_VERSION 1.3.1 8 | ENV HADOOP_PROFILE 2.4 9 | ENV HADOOP_VERSION 2.4.0 10 | 11 | RUN yum install -y \ 12 | bzip2 \ 13 | git \ 14 | java-1.8.0-openjdk \ 15 | java-1.8.0-openjdk-devel \ 16 | tar \ 17 | unzip \ 18 | && \ 19 | yum clean all 20 | 21 | RUN curl -sL --retry 3 \ 22 | "http://apache.arvixe.com/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop$HADOOP_PROFILE.tgz" \ 23 | | gunzip \ 24 | | tar x -C /opt/ \ 25 | && ln -s /opt/spark-$SPARK_VERSION-bin-hadoop$HADOOP_PROFILE /opt/spark 26 | 27 | # SCRIPTS AND ENVIRONMENTAL VARS 28 | 29 | ADD scripts/start-master.sh /start-master.sh 30 | ADD scripts/start-worker /start-worker.sh 31 | ADD scripts/spark-shell.sh /spark-shell.sh 32 | ADD scripts/spark-defaults.conf /spark-defaults.conf 33 | ADD scripts/remove_alias.sh /remove_alias.sh 34 | ENV SPARK_HOME /opt/spark 35 | 36 | ENV SPARK_MASTER_OPTS="-Dspark.driver.port=7001 -Dspark.fileserver.port=7002 -Dspark.broadcast.port=7003 -Dspark.replClassServer.port=7004 -Dspark.blockManager.port=7005 -Dspark.executor.port=7006 -Dspark.ui.port=4040 -Dspark.broadcast.factory=org.apache.spark.broadcast.HttpBroadcastFactory" 37 | ENV SPARK_WORKER_OPTS="-Dspark.driver.port=7001 -Dspark.fileserver.port=7002 -Dspark.broadcast.port=7003 -Dspark.replClassServer.port=7004 -Dspark.blockManager.port=7005 -Dspark.executor.port=7006 -Dspark.ui.port=4040 -Dspark.broadcast.factory=org.apache.spark.broadcast.HttpBroadcastFactory" 38 | 39 | ENV SPARK_MASTER_PORT 7077 40 | ENV SPARK_MASTER_WEBUI_PORT 8080 41 | ENV SPARK_WORKER_PORT 8888 42 | ENV SPARK_WORKER_WEBUI_PORT 8081 43 | 44 | EXPOSE 8080 7077 8888 8081 4040 7001 7002 7003 7004 7005 7006 45 | -------------------------------------------------------------------------------- /centos-spark/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-zeppelin:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-spark1 7 | LOG_DIR:=/srv/docker/lon-dev-spark1/log 8 | 9 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 10 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 11 | 12 | # Because of a bug, the container has to run as privileged, 13 | # otherwise you end up with "could not open session" error. 14 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" \ 15 | --privileged \ 16 | -P \ 17 | -v $(LOG_DIR):/var/log \ 18 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 19 | 20 | all: build 21 | 22 | build: 23 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 24 | 25 | run: clean 26 | mkdir -p $(LOG_DIR) 27 | docker run -d $(DOCKER_RUN_COMMON) 28 | 29 | bash: clean 30 | mkdir -p $(LOG_DIR) 31 | docker run --privileged -t -i $(DOCKER_RUN_COMMON) /bin/bash 32 | 33 | # Removes existing containers. 34 | clean: 35 | ifneq ($(strip $(RUNNING)),) 36 | docker stop $(RUNNING) 37 | endif 38 | ifneq ($(strip $(ALL)),) 39 | docker rm $(ALL) 40 | endif 41 | 42 | # Deletes the directories. 43 | deepclean: clean 44 | sudo rm -rf $(LOG_DIR) 45 | -------------------------------------------------------------------------------- /centos-spark/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-spark 2 | 3 | A Dockerfile that produces a Centos-based Docker image that will run a standalone pre-build version of [ApacheSpark][spark]. 4 | 5 | [spark]: https://spark.apache.org/ 6 | 7 | 8 | ## Image Creation 9 | 10 | This example creates the image with the tag `internavenue/centos-spark`, but you can change this to use your own username. 11 | 12 | 13 | ``` 14 | $ docker build -t="internavenue/centos-spark" . 15 | ``` 16 | 17 | Alternately, you can run the following if you have *GNU Make* installed... 18 | 19 | ``` 20 | $ make 21 | ``` 22 | 23 | You can also specify a custom docker username like so: 24 | 25 | ``` 26 | $ make DOCKER_USER=internavenue 27 | ``` 28 | 29 | 30 | ## Usage 31 | 32 | ### Standalone single-node use 33 | ``` 34 | sudo docker run -t -i -p internavenue/centos-spark:centos7 35 | ``` 36 | 37 | Spark is by default placed at /opt/spark 38 | 39 | You can run a test (estimate Pi number) with the following command within the container 40 | 41 | ``` 42 | /opt/spark/bin/run-example SparkPi 10 43 | ``` 44 | 45 | ### Standalone cluster mode 46 | 47 | * Spin-up the master container 48 | 49 | ``` 50 | sudo sh start-master.sh 51 | ``` 52 | 53 | * Spin-up workers: 54 | 55 | ``` 56 | sudo sh start-worker.sh 57 | ``` 58 | 59 | * To launch a Spark shell against the master: 60 | 61 | ``` 62 | sudo sh spark-shell.sh 63 | ``` 64 | -------------------------------------------------------------------------------- /centos-spark/scripts/remove_alias.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | sed '1d' /etc/hosts > tmpHosts 3 | cat tmpHosts > /etc/hosts 4 | rm tmpHosts 5 | -------------------------------------------------------------------------------- /centos-spark/scripts/spark-defaults.conf: -------------------------------------------------------------------------------- 1 | spark.driver.port 7001 2 | spark.fileserver.port 7002 3 | spark.broadcast.port 7003 4 | spark.replClassServer.port 7004 5 | spark.blockManager.port 7005 6 | spark.executor.port 7006 7 | spark.ui.port 4040 8 | spark.broadcast.factory org.apache.spark.broadcast.HttpBroadcastFactory 9 | -------------------------------------------------------------------------------- /centos-spark/scripts/spark-shell.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export SPARK_LOCAL_IP=`awk 'NR==1 {print $1}' /etc/hosts` 3 | /remove_alias.sh # problems with hostname alias, see https://issues.apache.org/jira/browse/SPARK-6680 4 | cd /opt/spark 5 | ./bin/spark-shell \ 6 | --master spark://${SPARK_MASTER_PORT_7077_TCP_ADDR}:${SPARK_MASTER_ENV_SPARK_MASTER_PORT} \ 7 | -i ${SPARK_LOCAL_IP} \ 8 | --properties-file /spark-defaults.conf \ 9 | "$@" 10 | -------------------------------------------------------------------------------- /centos-spark/scripts/start-master.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export SPARK_MASTER_IP=`awk 'NR==1 {print $1}' /etc/hosts` 3 | export SPARK_LOCAL_IP=`awk 'NR==1 {print $1}' /etc/hosts` 4 | /opt/spark/sbin/start-master.sh --properties-file /spark-defaults.conf -i $SPARK_LOCAL_IP "$@" 5 | /bin/bash 6 | -------------------------------------------------------------------------------- /centos-spark/scripts/start-worker: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | cd /opt/spark 3 | export SPARK_LOCAL_IP=`awk 'NR==1 {print $1}' /etc/hosts` 4 | ./bin/spark-class org.apache.spark.deploy.worker.Worker \ 5 | spark://${SPARK_MASTER_PORT_7077_TCP_ADDR}:${SPARK_MASTER_ENV_SPARK_MASTER_PORT} \ 6 | --properties-file /spark-defaults.conf \ 7 | -i $SPARK_LOCAL_IP \ 8 | "$@" 9 | -------------------------------------------------------------------------------- /centos-spark/spark-shell.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | docker pull internavenue/centos-spark 3 | # Run the container, all ports randomly allocated in the host 4 | docker run -i -t -P --link spark_master:spark_master internavenue/centos-spark /spark-shell.sh "$@" 5 | -------------------------------------------------------------------------------- /centos-spark/start-master.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | docker pull internavenue/centos-spark 3 | # Run the container, all ports randomly allocated in the host 4 | docker run -d -t -P --name spark_master internavenue/centos-spark /start-master.sh "$@" 5 | -------------------------------------------------------------------------------- /centos-spark/start-worker.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | docker pull internavenue/centos-spark 3 | # Run the container, all ports randomly allocated in the host 4 | docker run -d -t -P --link spark_master:spark_master internavenue/centos-spark /start-worker.sh "$@" 5 | -------------------------------------------------------------------------------- /centos-zeppelin/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM internavenue/centos-base:centos7 2 | 3 | MAINTAINER Intern Avenue Dev Team 4 | 5 | RUN yum install -y \ 6 | bzip2 \ 7 | git \ 8 | java-1.8.0-openjdk \ 9 | java-1.8.0-openjdk-devel \ 10 | python-setuptools python-dev python-numpy \ 11 | npm \ 12 | tar \ 13 | unzip \ 14 | R \ 15 | && \ 16 | yum clean all 17 | 18 | RUN \ 19 | curl http://mirrors.ukfast.co.uk/sites/ftp.apache.org/maven/maven-3/3.3.3/binaries/apache-maven-3.3.3-bin.zip -o apache-maven-3.3.3-bin.zip && \ 20 | unzip apache-maven-3.3.3-bin.zip && \ 21 | mv apache-maven-3.3.3/ /opt/maven && \ 22 | ln -s /opt/maven/bin/mvn /usr/bin/mvn 23 | 24 | 25 | # Py4j for PySpark 26 | RUN easy_install py4j 27 | 28 | 29 | ADD scripts /scripts 30 | RUN chmod +x /scripts/build.sh 31 | RUN chmod +x /scripts/start.sh 32 | 33 | VOLUME ["/vagrant", "/zeppelin"] 34 | 35 | EXPOSE 8080 8081 36 | 37 | CMD ["/scripts/start.sh"] 38 | -------------------------------------------------------------------------------- /centos-zeppelin/Makefile: -------------------------------------------------------------------------------- 1 | # Substitute your own docker index username, if you like. 2 | DOCKER_USER=internavenue 3 | DOCKER_REPO_NAME=centos-zeppelin:centos7 4 | 5 | # Change this to suit your needs. 6 | CONTAINER_NAME:=lon-dev-zeppelin1 7 | LOG_DIR:=/srv/docker/lon-dev-zeppelin1/log 8 | 9 | RUNNING:=$(shell docker ps | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 10 | ALL:=$(shell docker ps -a | grep "$(CONTAINER_NAME) " | cut -f 1 -d ' ') 11 | 12 | # Because of a bug, the container has to run as privileged, 13 | # otherwise you end up with "could not open session" error. 14 | DOCKER_RUN_COMMON=--name="$(CONTAINER_NAME)" \ 15 | --privileged \ 16 | -P \ 17 | -v $(LOG_DIR):/var/log \ 18 | $(DOCKER_USER)/$(DOCKER_REPO_NAME) 19 | 20 | all: build 21 | 22 | build: 23 | docker build -t="$(DOCKER_USER)/$(DOCKER_REPO_NAME)" . 24 | 25 | run: clean 26 | mkdir -p $(LOG_DIR) 27 | docker run -d $(DOCKER_RUN_COMMON) 28 | 29 | bash: clean 30 | mkdir -p $(LOG_DIR) 31 | docker run --privileged -t -i $(DOCKER_RUN_COMMON) /bin/bash 32 | 33 | # Removes existing containers. 34 | clean: 35 | ifneq ($(strip $(RUNNING)),) 36 | docker stop $(RUNNING) 37 | endif 38 | ifneq ($(strip $(ALL)),) 39 | docker rm $(ALL) 40 | endif 41 | 42 | # Deletes the directories. 43 | deepclean: clean 44 | sudo rm -rf $(LOG_DIR) 45 | 46 | -------------------------------------------------------------------------------- /centos-zeppelin/README.md: -------------------------------------------------------------------------------- 1 | # docker-centos-zeppelin 2 | 3 | A Dockerfile that produces a Centos-based Docker image that will install the necessary dependencies to run the latest stable [Apache Zeppelin][zeppelin]. 4 | 5 | [zeppelin]: http://zeppelin.incubator.apache.org/ 6 | 7 | 8 | This image assumes a built version of Zeppelin installed at /zeppelin. See instructions below. 9 | 10 | ## Image Creation 11 | 12 | This example creates the image with the tag `internavenue/centos-zeppelin`, but you can change this to use your own username. 13 | 14 | 15 | ``` 16 | $ docker build -t="internavenue/centos-zeppelin" . 17 | ``` 18 | 19 | Alternately, you can run the following if you have *GNU Make* installed and if you'd like to build Zeppelin with an external Spark pre-built or custom build. By default, the Makefile choses an external pre-built Spark package. 20 | 21 | ``` 22 | $ make 23 | ``` 24 | 25 | You can also specify a custom docker username like so: 26 | 27 | ``` 28 | $ make DOCKER_USER=internavenue 29 | ``` 30 | 31 | ## Usage 32 | 33 | Zeppelin needs to connect to port 8081 for the web sockets, therefore it is suggested to map the default internal ports to the same ones in the host 34 | 35 | ``` 36 | sudo docker run -t -i -p 8080:8080 -p 8081:8081 -v /srv/docker/lon-dev-zeppelin1/zeppelin:/zeppelin internavenue/centos-zeppelin:centos7 37 | 38 | ``` 39 | 40 | ## Setup Zeppelin installation for the first time 41 | 42 | For this, you need to ssh into the container and run the `first_run.sh script` 43 | 44 | ``` 45 | sudo docker run -t -i -p 8080:8080 -p 8081:8081 -v /srv/docker/lon-dev-zeppelin1/zeppelin:/zeppelin internavenue/centos-zeppelin:centos7 bash 46 | ``` 47 | 48 | Once inside, execute 49 | ``` 50 | sh /scripts/first_run.sh 51 | ``` 52 | -------------------------------------------------------------------------------- /centos-zeppelin/scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Environment variables 4 | SPARK_PROFILE=1.6 5 | SPARK_VERSION=1.6.1 6 | HADOOP_PROFILE=2.6 7 | HADOOP_VERSION=2.6.0 8 | 9 | # Setup and run Zeppelin 10 | cd /zeppelin 11 | mvn -T "$(nproc)" clean package -DskipTests -Pspark-$SPARK_PROFILE -Dspark.version=$SPARK_VERSION -Phadoop-$HADOOP_PROFILE -Pyarn -Ppyspark 12 | 13 | -------------------------------------------------------------------------------- /centos-zeppelin/scripts/first_run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Environment variables 4 | SPARK_PROFILE=1.6 5 | SPARK_VERSION=1.6.1 6 | HADOOP_PROFILE=2.6 7 | HADOOP_VERSION=2.6.0 8 | 9 | # Download latest Zeppelin 10 | git clone https://github.com/apache/incubator-zeppelin.git /zeppelin 11 | 12 | # Setup and run Zeppelin 13 | cd /zeppelin 14 | mvn -T "$(nproc)" clean package -DskipTests -Pspark-$SPARK_PROFILE -Dspark.version=$SPARK_VERSION -Phadoop-$HADOOP_PROFILE -Pyarn -Ppyspark 15 | 16 | -------------------------------------------------------------------------------- /centos-zeppelin/scripts/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Run Zeppelin 4 | 5 | cd /zeppelin 6 | bin/zeppelin-daemon.sh start 7 | 8 | --------------------------------------------------------------------------------