Compare commits

...

273 Commits

Author SHA1 Message Date
Geoff Bourne
134eaedf23 Merge pull request #125 from HenryGessau/FTB
Add Feed-The-Beast (FTB) server modpack support
2017-02-13 22:23:33 -06:00
Henry Gessau
4a89f3c579 Add Feed-The-Beast (FTB) server modpack support
The popular mod site https://www.feed-the-beast.com provides server
modpacks to go with their client modpacks. These server modpacks
include a custom start script that must be used to launch the server.
2017-02-13 22:13:53 -05:00
Geoff Bourne
17420ed590 [es] Added HEALTHCHECK 2017-02-04 14:37:45 -06:00
Geoff Bourne
2125fa0855 [es] Tweak spacing on README 2017-02-02 20:53:47 -06:00
Geoff Bourne
5c14c30a78 [es] Include docker stack deploy instructions 2017-02-02 20:48:17 -06:00
Geoff Bourne
788d06c086 [es] Upgrade to 5.2.0
For #124
2017-02-02 20:28:12 -06:00
Geoff Bourne
1a88c96beb Merged branch master into master 2017-02-02 19:31:11 -06:00
Geoff Bourne
b8d69278e4 [es] Fix address binding for Swarm Mode 2017-01-23 10:25:50 -06:00
Geoff Bourne
4a7ecffcbb [es][kibana] Upgrade to 5.1.2 2017-01-15 07:04:27 -06:00
Geoff Bourne
9fe0021a7a [mc] Upgrade base image to openjdk
Fixes #122
2017-01-12 19:40:58 -06:00
Geoff Bourne
262816bd2d [es] Add note about increasing mmap count 2017-01-04 20:43:23 -06:00
Geoff Bourne
e44d27c00a [es] Fine java security grants
Fixes #119
* also switch/upgrade base to openjdk 8u111
2017-01-04 20:37:20 -06:00
Geoff Bourne
5062bc91ab [es] Fixed DISCOVER_HTTP_IP typo in README
Fixes #120
2017-01-04 19:56:33 -06:00
Geoff Bourne
dde4132d2c [cass] Switch mirror URL to pair.com 2017-01-01 13:29:52 -06:00
Geoff Bourne
9bb3628792 [kibana] Upgrade to 5.1.1 2016-12-09 15:23:06 -06:00
Geoff Bourne
03a5bb1ab0 [es] Upgrade to 5.1.1 2016-12-09 15:15:38 -06:00
Geoff Bourne
3a9a1dc043 [es] small command line fix (#117)
small command line fix
2016-12-09 10:55:08 -06:00
Eric Pugh
36ced1c630 small command line fix 2016-12-09 10:45:34 -05:00
Geoff Bourne
0cb0755739 [kibana] Upgrade to 5.0.2 2016-11-30 19:21:16 -06:00
Geoff Bourne
3e8eca6e28 [es] Upgrade to 5.0.2
Fixes #113
2016-11-29 22:05:13 -06:00
Geoff Bourne
a179f5f7ba [cass] Upgrade to 2.2.8 2016-11-29 19:14:05 -06:00
Geoff Bourne
f2955bcc2f [es] Bump to 5.0.1
* explicitly configure default JVM heap size
* /conf needed ownership fixed
For #112
2016-11-28 20:37:44 -07:00
Geoff Bourne
a0c1ed88d1 [kibana] Adjust binding hosting from old default 2016-11-13 15:18:37 -06:00
Geoff Bourne
de6d7a64ac Merge branch 'master' of github.com:itzg/dockerfiles 2016-11-13 14:59:47 -06:00
Geoff Bourne
3bf560bfbe [kibana] Upgrade to 5.0.0
* also switched to openjdk 8 base image
2016-11-13 14:59:22 -06:00
Geoff Bourne
f1b58323d3 [es] Fixed TYPE usage
Removed last of the --'s parameters
2016-11-05 10:46:32 -05:00
Geoff Bourne
d4a888073b [es] Upgrade to 5.0.0 2016-11-04 20:18:43 -05:00
Geoff Bourne
54844930bb [jenkins] Working around hub build issue 2016-10-23 09:52:25 -05:00
Geoff Bourne
b26714c9c1 [jenkins] Move COPY later in build 2016-10-23 09:36:16 -05:00
Geoff Bourne
f03a8f0edc [jenkins] Switch local ADD to COPY 2016-10-23 09:29:46 -05:00
Geoff Bourne
048beefadc [jenkins] Pre-installing graphviz (for dependency graphs, etc) 2016-10-23 00:35:02 -05:00
Geoff Bourne
de3545e8d9 Merge pull request #109 from manuelgu/patch-1
Fix formatting in minecraft README
2016-10-18 13:54:57 -05:00
manuelgu
e766301d1e Fix formatting 2016-10-18 13:59:43 +02:00
Geoff Bourne
3348083424 [mc] Fix game mode shorthand handling of s*
For #107
2016-10-02 07:50:19 -05:00
Geoff Bourne
1e0183a3b1 [es] Added ports and volumes summary 2016-10-01 09:52:40 -05:00
Geoff Bourne
fd0500feb2 [es] COPY start script 2016-09-30 22:02:11 -05:00
Geoff Bourne
e86138cdf2 [es] Upgrade to 2.4.1 2016-09-30 22:07:48 -04:00
Geoff Bourne
ddb69ced3b Merge pull request #106 from kstrauser/feature/noconsole-envvar
Added CONSOLE envvar to control console output
2016-09-22 22:07:46 -05:00
Kirk Strauser
c48f85cc4f Oops! --noconsole for non-bootstrap, too 2016-09-22 19:51:44 -07:00
Kirk Strauser
aa13deecdb Added CONSOLE envvar to control console output
By default, CONSOLE is true. When set to false, start-minecraft.sh
adds "--noconsole" to java. Use this to keep Spigot from burning CPU.
2016-09-22 19:51:44 -07:00
Geoff Bourne
4c0f24613c [cass] Upgrade to 2.2.7 2016-09-22 18:55:40 -04:00
Geoff Bourne
b5bcea7d61 [mc] Add SKIP_OWNERSHIP_FIX option
For #104
2016-09-10 08:22:30 -05:00
Geoff Bourne
76d4fd1bbc [mc] Check writability of /data before chown'ing it
For #104
2016-09-06 21:36:54 -05:00
Geoff Bourne
f7523eef4e [es] Upgrade to 2.4.0 2016-09-04 19:34:49 -05:00
Geoff Bourne
c38bfb22cc [es] Also adding host IP discovery for http 2016-09-04 16:10:08 -05:00
Geoff Bourne
8cea619c13 [es] Add support for Swarm Mode with proper transport publish computation 2016-09-04 15:25:04 -05:00
Geoff Bourne
e570ac8715 Merged mc/non-writable-home into master 2016-09-01 21:16:49 -05:00
Geoff Bourne
d14d666e24 [mc] Ensure home directory is writable
For #102
2016-08-30 17:11:10 -05:00
Geoff Bourne
8956d43c47 [jenkins] Declare VOLUME for home directory 2016-08-28 14:40:22 -05:00
Geoff Bourne
911fcf8b42 [mc] Correcting EULA usage in compose example in README
Part of #101
2016-08-15 22:04:36 -05:00
Geoff Bourne
3e61c8084f Merge pull request #101 from parthipanramesh/master
minecraft-server: EULA var needs to be a string (docker-compose.yml)
2016-08-15 21:59:24 -05:00
Parthipan Ramesh
fe6e8c04ff minecraft-server: EULA var needs to be a string (docker-compose.yml)
docker-compose refuses to build a container without the quotation marks.
2016-08-15 20:06:12 +02:00
Geoff Bourne
f1293ff979 Merge pull request #99 from jimtremblay/master
Add ability to change online-mode from environment variable when contained created
2016-08-03 21:16:47 -05:00
Jim Tremblay
5c5b8cd999 Add default value of ONLINE_MODE 2016-08-03 21:59:48 -04:00
Jim Tremblay
074424a5bd Add section about new option ONLINE_MODE 2016-08-03 21:58:07 -04:00
Jim Tremblay
99b1de0bbd Update start-minecraft.sh 2016-08-01 22:09:30 -04:00
Geoff Bourne
47c3350c10 [es] Fixed plugin installation after Alpine switch
For #98
2016-07-31 10:03:43 -05:00
Geoff Bourne
84bb96ef38 Merge pull request #97 from rakkhin/master
Add support for PAPER as possible Minecraft server
2016-07-22 06:53:34 -05:00
Tomasz Majer
ada4a1fab5 Mention PaperSpigot in README.md 2016-07-22 13:48:50 +02:00
Tomasz Majer
ea78bdd559 Add support for PAPER as possible Minecraft server 2016-07-21 18:32:45 +02:00
Geoff Bourne
fa790ab787 [es] Fixed whitespace in README 2016-07-10 16:51:44 -05:00
Geoff Bourne
281c044999 [es] Adding node type and min master variables
For #24
2016-07-10 16:32:55 -05:00
Geoff Bourne
b9dcdee34b Merge pull request #94 from jaychris/elasticsearch-fix-start
fixed env inheritance issue, re-ordered OPTS
2016-07-10 09:50:52 -05:00
Jay Christopherson
87b2ce1c24 fixed env inheritance issue with su command; re-ordered OPTS a bit so that --path.plugins will always be the last in order 2016-07-10 07:00:10 -07:00
Geoff Bourne
55e38181bd [es] Upgraded to 2.3.4 and based on alpine 2016-07-09 12:52:02 -05:00
Geoff Bourne
ac3cbe75a9 Merge pull request #90 from larrywright/larrywright-patch-1
Update start-minecraft.sh
2016-07-07 18:02:20 -05:00
Larry Wright
d89de80db8 Update start-minecraft.sh
Each time this script is run it downloads the modpack if one is specified. When it tries to unzip the file, if the files already exist in the plugins directory, the script will hang indefinitely because unzip asks for confirmation that you want to overwrite the existing files. Adding -o to the unzip command will tell it to overwrite the files. I suspect the world download has the same issue, but I don't use that and so can't really test it.
2016-07-07 09:17:13 -05:00
Geoff Bourne
1e1a572227 Merged branch master into master 2016-07-01 22:17:35 -05:00
Geoff Bourne
379905c6ff [mc] Use restify to lookup Spigot/Bukkit URLs at startup
For #87
2016-07-01 22:17:10 -05:00
Geoff Bourne
ec1dd96a7c [gb] Apply all files in /config to /data at startup 2016-06-27 11:16:09 -05:00
Geoff Bourne
413de37568 [gb] Allow dir or file of .git 2016-06-27 08:30:54 -05:00
Geoff Bourne
3147c5638f [gb] Option to auto-create and push existing content
For #85
2016-06-26 22:40:11 -05:00
Geoff Bourne
0832bb0c43 [mc] Update Spigot info in README
For #80 and #79
2016-06-11 18:49:18 -05:00
Geoff Bourne
b97348d703 [mc] Remove extraneous exec java call
Fixed #76
2016-06-11 18:44:23 -05:00
Geoff Bourne
4cff161deb [mc] Use new versions metadata json URL
For #83
2016-06-11 18:42:33 -05:00
Geoff Bourne
b1c0e598ad [gitblit] Fix -p usage in README 2016-06-11 18:32:09 -05:00
Geoff Bourne
63035c347b [gitblit] Upgrade to latest version and add repo init feature 2016-06-11 18:18:17 -05:00
Geoff Bourne
c806c425fd [mc] Properly quote parameters passed into entry point 2016-05-30 11:41:03 -05:00
Geoff Bourne
0defd266a6 [mc] Use ENTRYPOINT and pass through extra args
Enables experimenting for #80
2016-05-28 20:58:36 -05:00
Geoff Bourne
dd5a21067b [es] Upgrade to 2.3.2 2016-05-09 19:45:40 -05:00
Geoff Bourne
2d48bcb1a0 [cass] Upgrade to 2.2.6 2016-05-09 19:43:44 -05:00
Geoff Bourne
5617936f10 Pre-compute the Bukkit/Spigot download URLs
For #77
2016-05-09 19:28:25 -05:00
Geoff Bourne
b5e459ab0a ...try wget for Spigot download
#74
2016-04-24 12:40:59 -05:00
Geoff Bourne
ae9109e2bf ...remove debugging code from Spigot download
#74
2016-04-24 11:59:44 -05:00
Geoff Bourne
b9f247728f [mc] Detect and display curl error during Spigot/Bukkit download
#74
2016-04-24 10:50:48 -05:00
Geoff Bourne
3052cd1155 [mc] Normalize on SPIGOT for plugin/world setup
#75
2016-04-24 10:32:59 -05:00
Geoff Bourne
46c865a123 Only create /home/minecraft if absent
* only download/build Spigot/Bukkit when absent
* refactored download ops into functions
#72
2016-04-24 07:26:26 -05:00
Geoff Bourne
cf5d194b14 [mc] Robust handling of Forge, Bukkit, and Spigot version selection
* refactor server.properties sed ops into a utility function
* also switch to jq instead of jsawk
* simplify to BUILD_FROM_SOURCE from BUILD_SPIGOT_FROM_SOURCE
Fixes #70
2016-04-23 22:23:55 -05:00
Geoff Bourne
0ea4ea7d0c [cass] Make sure to enable start_rpc
* also note in titan-gremlin that 1.x of ES is needed
* provide docker compose snippet
Part of #68
2016-04-17 12:21:53 -05:00
Geoff Bourne
a6580b3fe3 [mc] Adding Docker stars to README 2016-04-16 16:45:50 -05:00
Sander
a4835ec331 Build spigot using buildtools (#67)
* Download buildtools

* Download buildtools

* Not a good idea to chmod /root

* Remove bukkit code

* fix jar not found

* Run start-minecraft as root (temp)

* Working buildtools

* Remove echo line

* Added more server properties, not working yet

* Show what server properties are being added

* Show what server properties are being added

* Add rcon.password

* Add max-world-size

* Added alot of server settings

* Expose rcon port

* Export home per itzg suggestion

* Update readme and server properties

* Env for building spigot from source

* Update readme
2016-04-16 11:26:13 -05:00
Geoff Bourne
21c9be4ec1 [es] upgrade to 2.3.0 and switch to Java 8 2016-04-01 21:54:54 -05:00
Geoff Bourne
786192e4b7 Added docker pulls badge with link to hub 2016-03-26 08:47:01 -05:00
Geoff Bourne
8610e7d621 Merge pull request #65 from jtcressy/master
[mc] resolved issues with downloading new server executable
2016-03-18 11:57:38 -05:00
jtcressy
a195583990 Cleaned Up Code per itzg's suggestion
Replaced hardcoded spigot_server.jar with $SERVER and broke up the line
to make it more readable.
2016-03-16 21:18:31 -06:00
jtcressy
a1ead0634e [mc] New method of downloading newer spigot server executable.
using double pipe "||", bash will continue to the next statement if the
first statement returns false or has an error. Using the -N option, wget
will overwrite the file if it is newer. So, if the -O option was used,
and both wget commands failed (both http and https were down) then wget
would overwrite the file with a 0 byte copy and effectively delete it.
-N works better in this case, since wget will not overwrite it with an
empty file if it can't download it.
2016-03-15 13:09:28 -06:00
jtcressy
b23fb93366 Undid method of pulling spigot_server.jar
rm -f $SERVER was a bad idea, as it deletes the server file regardless
of whether wget is able to download a new one. If you keep a copy of
spigot_server in the server directory, wget will fail if it's unable to
pull the file and it wont delete what you already have.
2016-03-15 01:05:37 -06:00
Geoff Bourne
68d731c096 [mc] Ensure a fresh Bukkit/Spigot jar is downloaded every time 2016-03-06 15:34:02 -06:00
Geoff Bourne
a4bd241be6 [mc] Adding Spigot/Bukkit 1.9 support
fixes #62
2016-03-04 22:13:02 -06:00
Geoff Bourne
5f104a32db [mc] Adding back text editors (vim and nano) 2016-03-03 22:32:22 -06:00
Geoff Bourne
03d9064b35 [mc] Putting back usermod solution 2016-02-27 17:10:11 -06:00
Geoff Bourne
b15ad9e799 Merge pull request #60 from itzg/mc/java8
Mc/java8
2016-02-21 20:02:37 -06:00
Geoff Bourne
17bfedd137 [cassandra] Upgrade to 2.2.5 2016-02-20 18:26:04 -06:00
Geoff Bourne
afa25e582d [mc] Upgrade base image to java:8 2016-02-20 18:05:41 -06:00
Geoff Bourne
7651cc658e [jenkins] Upgrade base to java:8-jdk 2016-02-04 21:19:42 -06:00
Geoff Bourne
dd0bcda23c Fixes #58 by allowing FML versions 1.8.8+ to be 3-part 2016-01-31 09:13:22 -06:00
Geoff Bourne
afa710455d Merge pull request #57 from Jadaw1n/master
[minecraft] Pass GID as docker option
2016-01-29 15:56:18 -06:00
Piero Steinger
70a55e3be1 [minecraft] Pass GID as docker option 2016-01-29 20:50:53 +01:00
Geoff Bourne
13ee106dac Merge pull request #51 from nlloyd/master
Adding gamerule.txt configuration file handling (optional)
2016-01-06 15:53:16 -06:00
Nick Lloyd
6253d5ddc0 Merge branch 'itzg-master' 2016-01-06 15:56:50 -05:00
Nick Lloyd
63e3123ab0 gamerules.txt is now bootstrap.txt 2016-01-06 15:55:45 -05:00
Geoff Bourne
1be18346ce [mc] Add Bukkit/Spigot support to MODPACK download-install 2016-01-03 09:37:27 -06:00
Geoff Bourne
9a90acab23 [mc] Fixed typo in Dockerfile 2016-01-01 22:23:26 -06:00
Geoff Bourne
edd69c40f6 Merge pull request #52 from sshipway/master
Add Spigot support, and non-zip URLs
2016-01-01 22:00:14 -06:00
Steve Shipway
582c60cd03 Add /plugins mount for external bukkit plugins
Add TYPE=BUKKIT documentation
2016-01-02 13:11:07 +13:00
Steve Shipway
13a6d91295 Fix typo 2016-01-02 12:20:39 +13:00
Steve Shipway
d0263f31d6 Add bukkit/spigot type download 2016-01-02 12:12:20 +13:00
Steve Shipway
4ab31a049b Allow non-ZIP urls for download
Add directory rename for Spigot
2016-01-02 11:33:05 +13:00
Nick Lloyd
4b74d13f08 removing old exec java call 2016-01-01 17:11:10 -05:00
Nick Lloyd
2afbdc959e added special handling for on startup gamerules (/gamerule commands), unfortunately will clobber stdin for the running server process 2016-01-01 17:06:56 -05:00
Geoff Bourne
9fa27b9a3d [mc] Adding MODPACK download option similar to WORLD 2016-01-01 12:39:43 -06:00
Geoff Bourne
16b3f18400 Merge pull request #49 from sshipway/master
Add WORLD env var to download save via HTTP, and other fixes
2015-12-22 10:42:54 -06:00
Geoff Bourne
79f9e02446 [cassandra] Upgrade to 2.2.4 2015-12-22 10:19:48 -06:00
Steve Shipway
a313c03fff Verify source URL and log if not working 2015-12-22 20:39:53 +13:00
Steve Shipway
e76068e63e Many improvements to help it work with automated schedulers
- Allow -e WORLD=http://xxxx/world.zip to download archived world and unpack
- Allow 'adventure' and 'spectator' game modes
- Allow /mods and /config mounts for shared Forge mods without using /data
- Quote many strings in case of blank values
- Let VERSION take lowercase options, and set to LATEST if blank or invalid
- Enable command blocks by default (needed for adventure worlds)
- Allow DIFFICULTY to be given numerically
- default to empty banned-players and banned-ip files to avoid error message
2015-12-22 19:53:29 +13:00
root
2427cae5a2 Quote pathnames in case of spaces and such 2015-12-19 21:50:44 +13:00
root
e902c6f40f Set command blocks enabled on servers by default; improved use of
http world download.
2015-12-19 21:48:09 +13:00
Steve
ef34025dd8 Add support for download of world in zipfile
WORLD=http://hostname/world.zip
Zipfile should contain world/ directory, and optionally any required mods in mods/ as well as optionally
a default server.properties file (overwritten by any env vars)
Also export volumes /mods and /config, the contents of which are copied to /data/mods and /data/config.  This
allows shared read-only mounts for modules without affecting world.
2015-12-19 15:32:29 +13:00
Geoff Bourne
0acedd04b9 Merge remote-tracking branch 'refs/remotes/origin/mc-issue-47' 2015-12-01 21:47:02 -06:00
Geoff Bourne
2f5402195c Merge remote-tracking branch 'refs/remotes/origin/master' into mc-issue-47 2015-11-30 21:51:19 -06:00
Geoff Bourne
764ae807e0 Avoid text file busy prior to exec sudo 2015-11-30 20:56:25 -06:00
Geoff Bourne
32cb5f44e4 [mc] also apply to white-list property 2015-11-28 23:02:43 -06:00
Geoff Bourne
a6e32f0ea9 Merge pull request #46 from everett-toews/whitelist
Whitelist players
2015-11-28 22:37:18 -06:00
Everett Toews
111883e0d5 Whitelist players 2015-11-28 22:11:01 -06:00
Geoff Bourne
847f403bd3 [es] Fixed #45 with corrected binding and re-worked example
* also upgraded to 2.1.0
* added a MULTICAST env var for supporting networks
2015-11-28 11:35:59 -06:00
Geoff Bourne
39bb0d75e2 [cassandra] Upgrade to 2.1.11 2015-11-04 18:24:02 -06:00
Geoff Bourne
01473c4e43 Fixes #44 : use 2.0 plugin install syntax 2015-11-04 18:21:46 -06:00
Geoff Bourne
b3a79d6b08 [es] Upgrade to 2.0.0 2015-10-29 19:58:28 -05:00
Geoff Bourne
5484f50659 [es] Upgrade to 1.7.3 2015-10-29 19:35:20 -05:00
Geoff Bourne
53e727298e Refreshing apt baseline 2015-10-29 19:17:34 -05:00
Geoff Bourne
a4aa177d6e Merge pull request #43 from everett-toews/patch-1
Consistent use of name "mc" everywhere
2015-10-09 08:01:13 -05:00
Everett Toews
a412cfddad Missed one... 2015-10-08 21:01:24 -05:00
Everett Toews
594c9873c4 Consistent use of name "mc" everywhere 2015-10-08 20:57:03 -05:00
Geoff Bourne
94442458e3 [cassandra] Upgrade to 2.1.9 2015-10-03 07:19:36 -05:00
Geoff Bourne
f75d735540 Merge branch 'master' of github.com:itzg/dockerfiles 2015-10-03 07:07:19 -05:00
Geoff Bourne
fec75cb117 Add support for level type and generator settings 2015-10-03 07:05:01 -05:00
Geoff Bourne
007fca149c Adding info about using Docker Compose 2015-08-15 10:06:32 -05:00
Geoff Bourne
ac608b7abb Refreshed devbox versions and run with non-root user 2015-07-24 15:21:01 -05:00
Geoff Bourne
7f048c5e8b [es] Adding CLUSTER_FROM feature for migrating cluster data directories 2015-07-24 12:51:21 -04:00
Geoff Bourne
53932e64f2 [es] Upgrade to 1.7.0 and add /conf/env override feature
fixes #39 and #40
2015-07-23 20:46:06 -05:00
Geoff Bourne
19b77ba18b [kibana] Upgrade to 4.1.1
resolves #38
2015-07-18 09:27:08 -05:00
Geoff Bourne
f911230c1b [titan-gremlin] Refresh of base packages 2015-07-18 09:15:39 -05:00
Geoff Bourne
1c7469bb8c [ubuntu-openjdk-7] Add unzip to base packages 2015-07-18 09:12:13 -05:00
Geoff Bourne
b5abb012db [cass] Upgraded to 2.1.8 2015-07-18 08:46:44 -05:00
Geoff Bourne
64b428f920 Refresh packages on ubuntu-openjdk-7 base 2015-07-16 21:48:39 -05:00
Geoff Bourne
9ffdc49c1b Merge pull request #35 from domse/patch-1
Update README.md
2015-06-22 06:52:03 -05:00
domse
3f5fa1642b Update README.md
Corrected a little frustrating misspelling.
2015-06-22 10:57:42 +02:00
Geoff Bourne
6570028c06 Merge pull request #34 from nichivo/master
Fix for new Forge URLs from 1.7.10-10.13.2.1300
2015-06-13 07:45:44 -05:00
nichivo
ed19d745cb URL format changed for Forge 1.7.10 from 10.13.2.1300 2015-06-13 16:51:07 +10:00
nichivo
f2e6696368 Updated Forge usage docs and set FORGEVERSION=RECOMMENDED by default 2015-06-13 16:49:08 +10:00
Geoff Bourne
83c31483f7 Merge pull request #32 from timvisher/feature/add-difficulty-knob
Add difficulty knob.
2015-06-11 18:25:28 -05:00
Geoff Bourne
b077b3fcf2 Fixing #33 : upgrade kibana to 4.1.0 2015-06-10 21:48:52 -05:00
Geoff Bourne
81ab299419 Fixing #29 : upgrade logstash to 1.5.0 (GA) 2015-06-10 21:46:05 -05:00
Tim Visher
53a0d0cf7a Default to easy. 2015-06-10 15:12:05 -04:00
Tim Visher
99b884f18a Add note to README about setting world difficulty. 2015-06-10 15:00:53 -04:00
Tim Visher
ebc0405e72 typo. 2015-06-10 14:14:31 -04:00
Tim Visher
b86370295c Add difficulty knob. 2015-06-10 14:13:36 -04:00
Geoff Bourne
7e624b90dd [es] Upgraded to 1.6.0 2015-06-09 19:57:30 -05:00
Geoff Bourne
6ba5fe29c1 Merge pull request #26 from 55chevypickup/patch-1
Added the ability to select forge version
2015-05-21 19:49:43 -05:00
Geoff Bourne
f9c7dddb19 [titan-gremin] Fixed linked ES container lookup
* removed unnecessary complexity from README
2015-05-19 20:41:17 -05:00
Geoff Bourne
ea32f70dd7 [logstash] Upgrade to 2.0.15 2015-05-19 19:50:44 -05:00
55chevypickup
0f466e2146 Added the ability to select forge version
Added the ability to select forge version by adding -e FORGEVERSION=10.13.3.1403-1.7.10 or -e FORGEVERSION=RECOMMENDED
2015-05-11 15:45:23 -05:00
Geoff Bourne
128dd8950a [es] Upgraded to 1.5.2 2015-04-27 21:31:35 -05:00
Geoff Bourne
5c947fd4ab [logstash] Added README 2015-04-12 22:11:10 -05:00
Geoff Bourne
5792b2996a Adding logstash image with pre-install of elasticsearch_groom 2015-04-12 11:09:49 -05:00
Geoff Bourne
57ca565d64 [es] Upgrade to 1.5.1 2015-04-12 08:01:33 -05:00
Geoff Bourne
63925a794c For #19: added PVP env var options
* also adding a marker env var for MCCY to reference
2015-03-29 13:39:25 -05:00
Geoff Bourne
d4d070018a [mc] Adding APT_GET_UPDATE to ensure latest base image is used on hub 2015-03-28 13:16:10 -05:00
Geoff Bourne
8594054047 Fixing #21 by using sudo instead of su 2015-03-28 13:10:39 -05:00
Geoff Bourne
6f62af7d85 Fixed #22: upgraded ES to 1.5.0 2015-03-26 02:26:27 +00:00
Geoff Bourne
b1f9d1c7c6 Use Forge recommended (not latest) version
* Misc Dockerfile cleanup
** use COPY instead of ADD
** wget is now pre-installed by base image
2015-03-20 20:26:43 -05:00
Geoff Bourne
8c3b0a720d Merge pull request #20 from justinclayton/patch-1
minecraft-server: fixing quotes so volume will create correctly
2015-03-17 12:44:48 -05:00
Justin Clayton
cc3730e5a9 minecraft-server: fixing quotes so volume will create correctly
Single quotes don't work for VOLUME, but double quotes do.
2015-03-17 10:37:47 -07:00
Geoff Bourne
7b58d59cef Add kibana to build 2015-03-08 19:05:34 -05:00
Geoff Bourne
84c3ea2465 Adding a Kibana 4 image 2015-03-08 18:54:37 -05:00
Geoff Bourne
78d9add46c Go ahead and install with openjdk image 2015-03-08 17:34:50 -05:00
Geoff Bourne
2f18e7be04 Merge pull request #18 from itzg/mc-attach
[mc] Update README to describe attach mode
2015-03-07 13:12:16 -06:00
Geoff Bourne
011108cd7e Fix typo in TLS info 2015-03-07 11:41:26 -06:00
Geoff Bourne
1600b75513 [mc] Update README to describe attach mode 2015-03-06 22:21:26 -06:00
Geoff Bourne
9962d28f41 Dangling forge-data reference 2015-03-05 15:16:35 -06:00
Geoff Bourne
ea08a6b496 Consistent description of /path/on/host 2015-03-05 15:13:17 -06:00
Geoff Bourne
a61d44ff30 Webhook into CircleCI 2015-03-05 15:10:28 -06:00
Geoff Bourne
5e14d3fbdd Improve Forge instructions 2015-03-05 15:04:48 -06:00
Geoff Bourne
eb28c2c980 Add docker service to CircleCI config 2015-03-05 14:34:28 -06:00
Geoff Bourne
024800201f Fix build script 2015-03-05 14:32:50 -06:00
Geoff Bourne
32e5f94a87 Configuring CircleCI to perform docker build to "test" 2015-03-05 14:30:46 -06:00
Geoff Bourne
88032acbfb Merge pull request #17 from itzg/forge-2
Resolves #14
2015-03-05 14:18:17 -06:00
Geoff Bourne
22e1abe628 [minecraft-server] Update README with new TYPE option 2015-03-05 14:16:14 -06:00
Geoff Bourne
01d9c54575 Simplify down our options when it comes to forge versions 2015-03-04 22:21:52 -06:00
Geoff Bourne
fab9669b42 Merge remote-tracking branch 'remotes/dan/forge' into forge-2 2015-03-04 21:35:35 -06:00
Daniel L. Polanco
df09adbfd7 Add non-working code to work with Goeff 2015-03-04 20:07:37 -07:00
Geoff Bourne
9e373d8b4d Update README.md 2015-03-04 19:35:09 -06:00
Daniel L. Polanco
2f4b73d862 Remove commented out cd /data from testing 2015-03-04 18:17:20 -07:00
Daniel L. Polanco
a252d794f9 Fix bad variable names 2015-03-04 18:15:36 -07:00
Daniel L. Polanco
79438e14de Simplify start-minecraft.sh 2015-03-04 17:47:54 -07:00
Daniel L. Polanco
ddbc7e9618 Add apt-get update to beginning of Dockerfile 2015-03-04 17:06:51 -07:00
Daniel L. Polanco
87140179f2 Add option for Vanilla or Forge server 2015-03-04 16:55:57 -07:00
Daniel L. Polanco
14a1e5fb2a Add initial version of forge download scraper 2015-03-01 21:39:38 -07:00
Geoff Bourne
2e8704a311 Merge pull request #13 from steveblackmon/master
bump to 1.4.4
2015-02-20 06:30:30 -06:00
Steve Blackmon
b1741cab7b bump to 1.4.4 2015-02-19 22:48:23 -06:00
Geoff Bourne
d63bc698d8 [jenkins] Added JNLP port info to README 2015-02-17 19:35:39 -06:00
Geoff Bourne
574fc53a55 Adding a fixed port for JNLP launched slave agents 2015-02-17 19:32:47 -06:00
Geoff Bourne
b75379a980 [jenkins] Adding git and openjdk install example 2015-02-17 19:11:53 -06:00
Geoff Bourne
086d9fb4ae [jenkins] Initial commit of self-upgrading Jenkins 2015-02-16 22:30:06 -06:00
Geoff Bourne
214fcda183 [titan-gremlin] Updated README for itzg/cassandra usage 2015-02-16 14:52:19 +00:00
Geoff Bourne
4dff67e03b [titan-gremlin] Automatically use 'itzg/cassandra' image's publish-as address 2015-02-16 14:50:03 +00:00
Geoff Bourne
78d82b334b [cassandra] Creating a Cassandra image that works with titan-gremlin and Titan Browser 2015-02-16 14:48:42 +00:00
Geoff Bourne
3059282c7a [ubuntu-openjdk-7] Refresh the apt cache 2015-02-15 06:18:07 +00:00
Geoff Bourne
88509c66a6 [titan-gremlin] Adding apt-clean and skipping extra bash in CMD spec 2015-02-15 06:12:51 +00:00
Geoff Bourne
307a9b119f [titan-gremlin] Fix typo in README 2015-02-15 00:08:18 -06:00
Geoff Bourne
6c58660a73 [titan-gremlin] Making it super easy to link to Cassandra and ES containers 2015-02-15 06:05:08 +00:00
Geoff Bourne
b7f5088b13 Merge pull request #12 from dfanchon/patch-1
Change ES version to 1.4.3
2015-02-13 08:38:23 -06:00
Didier Fanchon
abee16a143 Change ES version to 1.4.3 2015-02-13 15:36:48 +01:00
Geoff Bourne
8319b336c7 [minecraft-server] Updated README for new -e UID option (fixes #9) 2015-01-28 19:52:42 -06:00
Geoff Bourne
6ea862859b * Updating openjdk base image 2015-01-27 22:01:25 -06:00
Geoff Bourne
88a796bb44 Issue #9: performing usermod to allow for -e provided uid of the minecraft server process
* corrected .dockerignore to allow for a $(pwd)/data for local testing of -v
2015-01-26 03:29:35 +00:00
Geoff Bourne
a8c3afbe88 Merge pull request #10 from andreasheil/master
propagate SIGTERM to the Minecraft process
2015-01-05 18:16:23 -06:00
Andreas Heil
60b6eea1e2 propagate SIGTERM to the Minecraft process 2015-01-05 10:32:31 +01:00
Geoff Bourne
bc9afcd659 [minecraft-server] Issue #9: explicitly adding user in container with UID=1000 2015-01-03 14:17:05 +00:00
Geoff Bourne
052f80d849 [minecraft-server] Issue #9: Added back the /start file in the image 2015-01-01 23:47:12 +00:00
Geoff Bourne
7e847829ee * also moved EULA check before download to fail-fast 2015-01-01 16:01:15 +00:00
Geoff Bourne
44c0eee0f9 Updating minecraft-server README with SEED and MODE options 2015-01-01 09:22:59 -06:00
Geoff Bourne
0337f9fac1 Adding Minecraft -e options for the game mode and level seed 2015-01-01 15:10:41 +00:00
Geoff Bourne
287185919a Upgrading to ES 1.4.2 2014-12-22 20:44:27 -06:00
Geoff Bourne
b895e07e82 Default the versioning to grab latest stable 2014-12-06 10:26:03 -06:00
Geoff Bourne
6396e58d3c Upgrading default minecraft server to 1.8.1 2014-12-01 04:05:12 +00:00
Geoff Bourne
4de10e1ba8 Reposition ES_VERSION after apt-get operations 2014-11-30 21:39:59 -06:00
Geoff Bourne
1a364ae733 Upgrading ES to 1.4.1 2014-11-30 18:56:16 -06:00
Geoff Bourne
9ffa2daeaa Fixing minor typos in README 2014-11-30 17:59:09 -06:00
Geoff Bourne
8973e7dc7b Deprecating the elasticsearch-marvel image 2014-11-15 15:29:49 -06:00
Geoff Bourne
3c8db58c7e Adding 1.4 stream at 1.4.0 2014-11-15 21:15:33 +00:00
Geoff Bourne
ee9f27546b Removing command-echoing in start script and adding info output 2014-11-15 21:12:49 +00:00
Geoff Bourne
8a2199a890 Added a README 2014-11-15 15:02:27 -06:00
Geoff Bourne
b4be1b37bd Added support for installing plugins 2014-11-15 20:10:06 +00:00
Geoff Bourne
d590bc62c1 Added PUBLISH_AS capability 2014-11-15 18:05:01 +00:00
Geoff Bourne
9349ca6d04 Initial setup of direct-from-elasticsearch.org install 2014-11-15 04:39:34 +00:00
Geoff Bourne
9e845521a9 Updated README for enhancement #6
Also trimming trailing whitespace
2014-11-09 10:49:31 -06:00
Geoff Bourne
5557f91c79 Adding image download and scaling logic for enhancement #6 2014-11-09 16:27:05 +00:00
Geoff Bourne
c324403f95 Merge pull request #5 from justfalter/minecraft-proper-shutdown
Fix minecraft shutdown
2014-11-01 18:40:56 -05:00
Mike Ryan
9fe8d6cca6 Use 'exec' syntax, fix signal handling
- Fix to allow signals to pass into the container, properly.
  'docker stop ...' was resorting to SIGKILL to stop the container,
  which results in data loss. This change switches CMD to 'exec' mode,
  ensuring signals make their way to the java process so that things
  shut down properly.
2014-11-01 18:17:15 -05:00
Geoff Bourne
55cffbb598 Merge pull request #4 from justfalter/minecraft-drop-privs
Drop privileges before starting server
2014-11-01 17:37:14 -05:00
Mike Ryan
4ff077f151 Drop privileges before starting server
- Create 'minecraft' user account within image.
- Drop to 'minecraft' user before starting server.
2014-11-01 15:35:36 -05:00
Geoff Bourne
5566cf0953 Updating apt-get baseline for openjdk-7 2014-10-13 13:56:21 +00:00
Geoff Bourne
5d3845a9ba Added note about multiple containers 2014-09-28 16:48:44 -05:00
Geoff Bourne
b952ee6fdd Describe existing LEVEL option and fix typos in -v section 2014-09-28 16:27:03 -05:00
Geoff Bourne
8035aa5f69 Fixed some typos in the README 2014-09-25 16:51:54 -05:00
Geoff Bourne
84521eca53 [minecraft-server] General info about Docker port mappings and container naming 2014-09-20 15:54:23 -05:00
Geoff Bourne
77541a9689 Added support adding 'op' users
* Non-destructive MOTD setting
2014-09-20 14:10:48 +00:00
Geoff Bourne
716ff66b1b Adding a container for the Titan graph database distribution 2014-09-19 02:49:44 +00:00
Geoff Bourne
029e7d8974 Install nodejs to satisfy latest Jekyll installation requirements 2014-09-19 02:08:15 +00:00
Geoff Bourne
7d8429ef0a Allowing for pre-existing eula.txt
Adding memory settings info to README
2014-09-08 02:32:55 +00:00
Geoff Bourne
df155ee51c Updating to JDK 7u65 2014-09-08 02:08:24 +00:00
Geoff Bourne
f85240898d Added support for Minecraft server EULA and update default to 1.8 2014-09-07 23:18:20 +00:00
Geoff Bourne
84154c3d64 * Installing JDK, not just JRE
* Added usage examples in README
2014-07-17 01:56:03 +00:00
Geoff Bourne
6163e080cd Merge branch 'master' of https://github.com/itzg/dockerfiles 2014-07-16 23:10:14 +00:00
Geoff Bourne
7fb406c2bb * Initial controlled revision of gitblit docker
* Gitblit 1.6.0
2014-07-21 01:01:25 +00:00
Geoff Bourne
8168c62bdd * functional Titan+Rexter with internal ES and Persistit backend 2014-07-20 18:49:33 +00:00
Geoff Bourne
b354ba5981 * updating to java 7u55 2014-07-19 16:31:24 +00:00
Geoff Bourne
972036feb4 * Created devbox container 2014-07-16 23:09:33 +00:00
Geoff Bourne
6dbbcf61b7 Update README.md 2014-07-14 14:16:47 -05:00
Geoff Bourne
159c38c194 Formatting fix 2014-06-29 22:53:16 +00:00
Geoff Bourne
bef6a36476 Renamed /run to /start to avoid collisions 2014-06-29 22:51:41 +00:00
Geoff Bourne
ebb4ee2214 Adding Jekyll container which includes very basic starter content 2014-06-29 22:44:51 +00:00
63 changed files with 2688 additions and 70 deletions

17
.gitattributes vendored Normal file
View File

@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.iml
.idea

View File

@@ -2,3 +2,5 @@ dockerfiles
===========
Contains the various Dockerfile definitions I'm maintaining.
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/itzg/dockerfiles?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

9
build
View File

@@ -1,4 +1,11 @@
pkgs="ubuntu-openjdk-7 gvm spring-boot"
#!/bin/bash
pkgs=ubuntu-openjdk-7
pkgs="$pkgs minecraft-server"
pkgs="$pkgs elasticsearch"
pkgs="$pkgs kibana"
pkgs="$pkgs titan-gremlin"
pkgs="$pkgs cassandra"
for p in $pkgs
do

26
cassandra/Dockerfile Executable file
View File

@@ -0,0 +1,26 @@
FROM java:openjdk-8u72-jdk
MAINTAINER itzg
ENV CASSANDRA_VERSION 2.2.8
ADD http://apache.mirrors.pair.com/cassandra/$CASSANDRA_VERSION/apache-cassandra-$CASSANDRA_VERSION-bin.tar.gz /tmp/apache-cassandra.tgz
RUN tar -C /opt -zxf /tmp/apache-cassandra.tgz && \
rm /tmp/apache-cassandra.tgz
RUN mv /opt/apache-cassandra-$CASSANDRA_VERSION /opt/cassandra
ENV CASSANDRA_HOME /opt/cassandra
ENV CASSANDRA_CONF /conf
ENV CASSANDRA_DATA /data
WORKDIR $CASSANDRA_HOME
RUN ln -s $CASSANDRA_HOME/bin/* /usr/local/bin
VOLUME ["/data","/conf"]
EXPOSE 9042 9160 7000 7001
ADD cassandra.in.sh $CASSANDRA_HOME/cassandra.in.sh
RUN mv $CASSANDRA_HOME/bin/cassandra.in.sh $CASSANDRA_HOME/bin/orig.cassandra.in.sh
CMD ["/opt/cassandra/bin/cassandra", "-f"]

9
cassandra/README.md Normal file
View File

@@ -0,0 +1,9 @@
Yet another Cassandra image, but this one got container and non-container access right.
# Basic Usage
To support access from both Docker containers and external, non-Docker clients:
docker run -d --name cassandra -e PUBLISH_AS=192.168.59.103 -p 9160:9160 itzg/cassandra
replacing `192.168.59.103` with your Docker host's LAN IP address.

24
cassandra/cassandra.in.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
cassYml=$CASSANDRA_HOME/conf/cassandra.yaml
privateAddr=$(hostname -i)
seeds=${SEEDS:-${PUBLISH_AS:-$privateAddr}}
sed -i -e "s/- seeds:.*/- seeds: \"$seeds\"/" \
-e "s/listen_address:.*/listen_address: $privateAddr/" \
-e "s/rpc_address:.*/rpc_address: $privateAddr/" \
-e "s/start_rpc:.*/start_rpc: true/" \
-e "s#- /var/lib/cassandra/data#- $CASSANDRA_DATA#" \
$cassYml
if [ -n "$PUBLISH_AS" ]; then
sed -i -e "s/\(\s*#\)\?\s*broadcast_address:.*/broadcast_address: $PUBLISH_AS/" $cassYml
fi
# Copy over our tweaked files, but non-clobbering to let user have ultimate control
cp -rn $CASSANDRA_HOME/conf/* $CASSANDRA_CONF
# source the original
. $CASSANDRA_HOME/bin/orig.cassandra.in.sh

11
circle.yml Normal file
View File

@@ -0,0 +1,11 @@
machine:
services:
- docker
test:
override:
- ./build
notify:
webhooks:
- url: https://webhooks.gitter.im/e/4726bb683d8aed018486

30
devbox/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
FROM itzg/ubuntu-openjdk-7
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -yq git curl wget unzip openjdk-7-jdk && \
apt-get clean
ENV MAVEN_VER 3.3.3
ENV NODEJS_VER 0.12.7
RUN wget -O /tmp/maven.tgz http://apache.mirrors.pair.com/maven/maven-3/$MAVEN_VER/binaries/apache-maven-$MAVEN_VER-bin.tar.gz
RUN tar xvf /tmp/maven.tgz && rm /tmp/maven.tgz
ENV M2_HOME /opt/apache-maven-$MAVEN_VER
ENV PATH $PATH:$M2_HOME/bin
RUN curl -s https://raw.githubusercontent.com/isaacs/nave/master/nave.sh > /usr/local/bin/nave
RUN chmod +x /usr/local/bin/nave
RUN nave usemain latest
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME ["/shared"]
RUN useradd -m -d /home/developer developer
USER developer
RUN curl -s get.gvmtool.net | bash
WORKDIR /home/developer
CMD bash

25
devbox/README.md Normal file
View File

@@ -0,0 +1,25 @@
Provides a development/build environment for Java, Groovy, and NodeJS.
* Provides 'gvm' for Groovy (and more) installation management
* Provides 'nave' for NodeJS installation management
* Pre-installs the latest NodeJS via nave
## Using the persistent/shared workarea
Since devbox containers are intended to be disposable, the image is configured
with a "volume" at `/shared`.
There are a couple of ways you can leverage that volume. Either attach it to
a host-local directory:
docker run -it -v $(pwd)/workarea:/shared --rm itzg/devbox
or run a "base" container and mounts the `/shared` from that onto any
subsequent containers:
docker run --name devbox-base itzg/devbox touch /shared/READY
...later...
docker run -it --volumes-from devbox-base --rm itzg/devbox
**NOTE** I am using the `--rm` option so the devbox containers will be truly
"burn after use".

View File

@@ -1,5 +0,0 @@
FROM dockerfile/elasticsearch
MAINTAINER itzg
RUN /elasticsearch/bin/plugin -i elasticsearch/marvel/latest

View File

@@ -1,7 +1,5 @@
This image extends the official elasticsearch image by adding the Marvel Sense plugin. This will get you a system ready to use with the [ElasticSearch Getting Started Guide](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current).
**This image is now deprecated. **
With Marvel Sense installed you can access it using a URL like:
http://192.168.1.216:9200/_plugin/marvel/sense/index.html
(replacing the IP address shown here with your Docker host's)
Please use [itzg/elasticsearch](https://registry.hub.docker.com/u/itzg/elasticsearch/)
instead. See the plugins configuration section for that image to see how
to install Marvel.

32
elasticsearch/Dockerfile Executable file
View File

@@ -0,0 +1,32 @@
FROM openjdk:8u111-jre-alpine
MAINTAINER itzg
RUN apk -U add bash
ENV ES_VERSION=5.2.0
ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp/es.tgz
RUN cd /usr/share && \
tar xf /tmp/es.tgz && \
rm /tmp/es.tgz
EXPOSE 9200 9300
HEALTHCHECK --timeout=5s CMD wget -q -O - http://$HOSTNAME:9200/_cat/health
ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \
DEFAULT_ES_USER=elasticsearch \
ES_JAVA_OPTS="-Xms1g -Xmx1g"
RUN adduser -S -s /bin/sh $DEFAULT_ES_USER
VOLUME ["/data","/conf"]
WORKDIR $ES_HOME
COPY java.policy /usr/lib/jvm/java-1.8-openjdk/jre/lib/security/
COPY start /start
COPY log4j2.properties $ES_HOME/config/
CMD ["/start"]

248
elasticsearch/README.md Executable file
View File

@@ -0,0 +1,248 @@
This Docker image provides an easily configurable Elasticsearch node. Via port mappings, it is easy to create an arbitrarily sized cluster of nodes. As long as the versions match, you can mix-and-match "real" Elasticsearch nodes with container-ized ones.
# NOTE for use on Linux hosts
Elasticsearch 5.x requires that the virtual memory mmap count is set sufficiently for stable,
production use. [Refer to this guide for more information](https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html).
# Basic Usage
To start an Elasticsearch data node that listens on the standard ports on your host's network interface:
docker run -d -p 9200:9200 -p 9300:9300 itzg/elasticsearch
You'll then be able to connect to the Elasticsearch HTTP interface to confirm it's alive:
http://DOCKERHOST:9200/
{
"status" : 200,
"name" : "Charon",
"version" : {
"number" : "1.3.5",
"build_hash" : "4a50e7df768fddd572f48830ae9c35e4ded86ac1",
"build_timestamp" : "2014-11-05T15:21:28Z",
"build_snapshot" : false,
"lucene_version" : "4.9"
},
"tagline" : "You Know, for Search"
}
Where `DOCKERHOST` would be the actual hostname of your host running Docker.
# Simple, multi-node cluster
To run a multi-node cluster (3-node in this example) on a single Docker machine use:
docker run -d --name es0 -p 9200:9200 itzg/elasticsearch
docker run -d --name es1 --link es0 -e UNICAST_HOSTS=es0 itzg/elasticsearch
docker run -d --name es2 --link es0 -e UNICAST_HOSTS=es0 itzg/elasticsearch
and then check the cluster health, such as http://192.168.99.100:9200/_cluster/health?pretty
{
"cluster_name" : "elasticsearch",
"status" : "green",
"timed_out" : false,
"number_of_nodes" : 3,
"number_of_data_nodes" : 3,
"active_primary_shards" : 0,
"active_shards" : 0,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 0
}
If you have a Docker Swarm cluster already initialized you can download this
[docker-compose.yml](https://raw.githubusercontent.com/itzg/dockerfiles/master/elasticsearch/docker-compose.yml) and deploy a cluster using:
docker stack deploy -c docker-compose.yml es
With a `docker service ls` you can confirm 1 master, 2 data, and 1 gateway nodes are running:
```
ID NAME MODE REPLICAS IMAGE
9nwnno8hbqgk es_kibana replicated 1/1 kibana:latest
f5x7nipwmvkr es_gateway replicated 1/1 es
om8rly2yxylw es_data replicated 2/2 es
tdvfilj370yn es_master replicated 1/1 es
```
As you can see, there is also a Kibana instance included and available at port 5601.
# Health Checks
This container declares a [HEALTHCHECK](https://docs.docker.com/engine/reference/builder/#/healthcheck) that queries the `_cat/health`
endpoint for a quick, one-line gauge of health every 30 seconds.
The current health of the container is shown in the `STATUS` column of `docker ps`, such as
Up 14 minutes (healthy)
You can also check the history of health checks from `inspect`, such as:
```
> docker inspect -f "{{json .State.Health}}" es
{"Status":"healthy","FailingStreak":0,"Log":[...
```
# Configuration Summary
## Ports
* `9200` - HTTP REST
* `9300` - Native transport
## Volumes
* `/data` - location of `path.data`
* `/conf` - location of `path.conf`
# Configuration Details
The following configuration options are specified using `docker run` environment variables (`-e`) like
docker run ... -e NAME=VALUE ... itzg/elasticsearch
Since Docker's `-e` settings are baked into the container definition, this image provides an extra feature to change any of the settings below for an existing container. Either create/edit the file `env` in the `/conf` volume mapping or edit within the running container's context using:
docker exec -it CONTAINER_ID vi /conf/env
replacing `CONTAINER_ID` with the container's ID or name.
The contents of the `/conf/env` file are standard shell
NAME=VALUE
entries where `NAME` is one of the variables described below.
Configuration options not explicitly supported below can be specified via the `OPTS` environment variable. For example, by default `OPTS` is set with
OPTS=-Dnetwork.bind_host=_non_loopback_
_NOTE: That option is a default since `bind_host` defaults to `localhost` as of 2.0, which isn't helpful for
port mapping out from the container_.
## Cluster Name
If joining a pre-existing cluster, then you may need to specify a cluster name different than the default "elasticsearch":
-e CLUSTER=dockers
## Zen Unicast Hosts
When joining a multi-physical-host cluster, multicast may not be supported on the physical network. In that case, your node can reference specific one or more hosts in the cluster via the [Zen Unicast Hosts](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html#unicast) capability as a comma-separated list of `HOST:PORT` pairs:
-e UNICAST_HOSTS=HOST:PORT[,HOST:PORT]
such as
-e UNICAST_HOSTS=192.168.0.100:9300
## Plugins
You can install one or more plugins before startup by passing a comma-separated list of plugins.
-e PLUGINS=ID[,ID]
In this example, it will install the Marvel plugin
-e PLUGINS=elasticsearch/marvel/latest
Many more plugins [are available here](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-plugins.html#known-plugins).
## Publish As
Since the container gives the Elasticsearch software an isolated perspective of its networking, it will most likely advertise its published address with a container-internal IP address. This can be overridden with a physical networking name and port using:
-e PUBLISH_AS=DOCKERHOST:9301
_Author Note: I have yet to hit a case where this was actually necessary. Other
than the cosmetic weirdness in the logs, Elasticsearch seems to be quite tolerant._
## Node Name
Rather than use the randomly assigned node name, you can indicate a specific one using:
-e NODE_NAME=Docker
## Node Type
If you refer to [the Node section](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-node.html)
of the Elasticsearch reference guide, you'll find that there's three main types of nodes: master-eligible, data, and client.
In larger clusters it is important to dedicate a small number (>= 3) of master nodes. There are also cases where a large cluster may need dedicated gateway nodes that are neither master nor data nodes and purely operate as "smart routers" and have large amounts of CPU and memory to handle client requests and search-reduce.
To simplify all that, this image provides a `TYPE` variable to let you amongst these combinations. The choices are:
* (not set, the default) : the default node type which is both master-eligible and a data node
* `MASTER` : master-eligible, but holds no data. It is good to have three or more of these in a
large cluster
* `DATA` (or `NON_MASTER`) : holds data and serves search/index requests. Scale these out for elastic-y goodness.
* `GATEWAY` : only operates as a client node or a "smart router". These are the ones whose HTTP port 9200 will need to be exposed
A [Docker Compose](https://docs.docker.com/compose/overview/) file will serve as a good example of these three node types:
```
version: '2'
services:
gateway:
image: itzg/elasticsearch
environment:
UNICAST_HOSTS: master
TYPE: GATEWAY
ports:
- "9200:9200"
master:
image: itzg/elasticsearch
environment:
UNICAST_HOSTS: gateway
TYPE: MASTER
MIN_MASTERS: 2
data:
image: itzg/elasticsearch
environment:
UNICAST_HOSTS: master,gateway
TYPE: DATA
```
## Minimum Master Nodes
In combination with the `TYPE` variable above, you will also want to configure the minimum master nodes to [avoid split-brain](https://www.elastic.co/guide/en/elasticsearch/reference/2.3/modules-node.html#split-brain) during network outages.
The minimum, which can be calculated as `(master_eligible_nodes / 2) + 1`, can be set with the `MIN_MASTERS` variable.
Using the Docker Compose file above, a value of `2` is appropriate when scaling the cluster to 3 master nodes:
docker-compose scale master=3
## Multiple Network Binding, such as Swarm Mode
When using Docker Swarm mode the container is presented with multiple ethernet
devices. By default, all global, routable IP addresses are configured for
Elasticsearch to use as `network.host`.
That discovery can be overridden by providing a specific ethernet device name
to `DISCOVER_TRANSPORT_IP` and/or `DISCOVER_HTTP_IP`, such as
-e DISCOVER_TRANSPORT_IP=eth0
-e DISCOVER_HTTP_IP=eth2
## Heap size and other JVM options
By default this image will run Elasticsearch with a Java heap size of 1 GB. If that value
or any other JVM options need to be adjusted, then replace the `ES_JAVA_OPTS`
environment variable.
For example, this would allow for the use of 16 GB of heap:
-e ES_JAVA_OPTS="-Xms16g -Xmx16g"
Refer to [this page](https://www.elastic.co/guide/en/elasticsearch/reference/current/heap-size.html)
for more information about why both the minimum and maximum sizes were set to
the same value.

View File

@@ -0,0 +1,37 @@
version: '3'
services:
master:
image: itzg/elasticsearch
environment:
TYPE: MASTER
UNICAST_HOSTS: master
MIN_MASTERS: 1
deploy:
replicas: 1
update_config:
parallelism: 1
data:
image: itzg/elasticsearch
environment:
TYPE: DATA
UNICAST_HOSTS: master
deploy:
replicas: 2
update_config:
parallelism: 1
delay: 60s
gateway:
image: itzg/elasticsearch
ports:
- "9200:9200"
- "9300:9300"
environment:
TYPE: GATEWAY
UNICAST_HOSTS: master
kibana:
image: kibana
ports:
- "5601:5601"
environment:
ELASTICSEARCH_URL: http://gateway:9200

View File

@@ -0,0 +1,6 @@
grant {
// JMX Java Management eXtensions
permission javax.management.MBeanTrustPermission "register";
permission javax.management.MBeanServerPermission "createMBeanServer";
permission javax.management.MBeanPermission "-#-[-]", "queryNames";
};

View File

@@ -0,0 +1,74 @@
status = error
# log action execution errors for easier debugging
logger.action.name = org.elasticsearch.action
logger.action.level = debug
appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n
appender.rolling.type = RollingFile
appender.rolling.name = rolling
appender.rolling.fileName = ${sys:es.logs}.log
appender.rolling.layout.type = PatternLayout
appender.rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
appender.rolling.filePattern = ${sys:es.logs}-%d{yyyy-MM-dd}.log
appender.rolling.policies.type = Policies
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.rolling.policies.time.interval = 1
appender.rolling.policies.time.modulate = true
rootLogger.level = info
rootLogger.appenderRef.console.ref = console
#rootLogger.appenderRef.rolling.ref = rolling
appender.deprecation_rolling.type = RollingFile
appender.deprecation_rolling.name = deprecation_rolling
appender.deprecation_rolling.fileName = ${sys:es.logs}_deprecation.log
appender.deprecation_rolling.layout.type = PatternLayout
appender.deprecation_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%.10000m%n
appender.deprecation_rolling.filePattern = ${sys:es.logs}_deprecation-%i.log.gz
appender.deprecation_rolling.policies.type = Policies
appender.deprecation_rolling.policies.size.type = SizeBasedTriggeringPolicy
appender.deprecation_rolling.policies.size.size = 1GB
appender.deprecation_rolling.strategy.type = DefaultRolloverStrategy
appender.deprecation_rolling.strategy.max = 4
logger.deprecation.name = org.elasticsearch.deprecation
logger.deprecation.level = warn
#logger.deprecation.appenderRef.deprecation_rolling.ref = deprecation_rolling
logger.deprecation.additivity = false
appender.index_search_slowlog_rolling.type = RollingFile
appender.index_search_slowlog_rolling.name = index_search_slowlog_rolling
appender.index_search_slowlog_rolling.fileName = ${sys:es.logs}_index_search_slowlog.log
appender.index_search_slowlog_rolling.layout.type = PatternLayout
appender.index_search_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n
appender.index_search_slowlog_rolling.filePattern = ${sys:es.logs}_index_search_slowlog-%d{yyyy-MM-dd}.log
appender.index_search_slowlog_rolling.policies.type = Policies
appender.index_search_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.index_search_slowlog_rolling.policies.time.interval = 1
appender.index_search_slowlog_rolling.policies.time.modulate = true
logger.index_search_slowlog_rolling.name = index.search.slowlog
logger.index_search_slowlog_rolling.level = trace
logger.index_search_slowlog_rolling.appenderRef.index_search_slowlog_rolling.ref = console
logger.index_search_slowlog_rolling.additivity = false
appender.index_indexing_slowlog_rolling.type = RollingFile
appender.index_indexing_slowlog_rolling.name = index_indexing_slowlog_rolling
appender.index_indexing_slowlog_rolling.fileName = ${sys:es.logs}_index_indexing_slowlog.log
appender.index_indexing_slowlog_rolling.layout.type = PatternLayout
appender.index_indexing_slowlog_rolling.layout.pattern = [%d{ISO8601}][%-5p][%-25c] %marker%.10000m%n
appender.index_indexing_slowlog_rolling.filePattern = ${sys:es.logs}_index_indexing_slowlog-%d{yyyy-MM-dd}.log
appender.index_indexing_slowlog_rolling.policies.type = Policies
appender.index_indexing_slowlog_rolling.policies.time.type = TimeBasedTriggeringPolicy
appender.index_indexing_slowlog_rolling.policies.time.interval = 1
appender.index_indexing_slowlog_rolling.policies.time.modulate = true
logger.index_indexing_slowlog.name = index.indexing.slowlog.index
logger.index_indexing_slowlog.level = trace
logger.index_indexing_slowlog.appenderRef.index_indexing_slowlog_rolling.ref = console
logger.index_indexing_slowlog.additivity = false

142
elasticsearch/start Executable file
View File

@@ -0,0 +1,142 @@
#!/bin/sh
pre_checks() {
mmc=$(sysctl vm.max_map_count|sed 's/.*= //')
if [[ $mmc -lt 262144 ]]; then
echo "
ERROR: As of 5.0.0 Elasticsearch requires increasing mmap counts.
Refer to https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
"
exit 1
fi
}
discoverIpFromLink() {
dev=$1
mode=$2
ip=`ipaddr show dev $dev scope global|awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; print $2 } }'`
echo "Discovered $mode address $ip for $dev"
OPTS="$OPTS -E $mode.host=$ip"
}
discoverAllGlobalIps() {
ips=`ipaddr show scope global|awk '$1 == "inet" { if (!match($2,"/32")) { gsub("/.*","",$2) ; addrs[length(addrs)] = $2 } } END { for (i in addrs) { if (i>0) printf "," ; printf addrs[i] } }'`
OPTS="$OPTS -E network.host=$ips"
}
setup_clustering() {
if [ -n "$CLUSTER" ]; then
OPTS="$OPTS -E cluster.name=$CLUSTER"
if [ -n "$CLUSTER_FROM" ]; then
if [ -d /data/$CLUSTER_FROM -a ! -d /data/$CLUSTER ]; then
echo "Performing cluster data migration from $CLUSTER_FROM to $CLUSTER"
mv /data/$CLUSTER_FROM /data/$CLUSTER
fi
fi
fi
if [ -n "$NODE_NAME" ]; then
OPTS="$OPTS -E node.name=$NODE_NAME"
fi
if [ -n "$MULTICAST" ]; then
OPTS="$OPTS -E discovery.zen.ping.multicast.enabled=$MULTICAST"
fi
if [ -n "$UNICAST_HOSTS" ]; then
OPTS="$OPTS -E discovery.zen.ping.unicast.hosts=$UNICAST_HOSTS"
fi
if [ -n "$PUBLISH_AS" ]; then
OPTS="$OPTS -E transport.publish_host=$(echo $PUBLISH_AS | awk -F: '{print $1}')"
OPTS="$OPTS -E transport.publish_port=$(echo $PUBLISH_AS | awk -F: '{if ($2) print $2; else print 9300}')"
fi
if [ -n "$MIN_MASTERS" ]; then
OPTS="$OPTS -E discovery.zen.minimum_master_nodes=$MIN_MASTERS"
fi
}
install_plugins() {
if [ -n "$PLUGINS" ]; then
for p in $(echo $PLUGINS | awk -v RS=, '{print}')
do
echo "Installing the plugin $p"
$ES_HOME/bin/elasticsearch-plugin install $p
done
else
mkdir -p $ES_HOME/plugins
fi
}
setup_personality() {
if [ -n "$TYPE" ]; then
case $TYPE in
MASTER)
OPTS="$OPTS -E node.master=true -E node.data=false"
;;
GATEWAY)
OPTS="$OPTS -E node.master=false -E node.data=false"
;;
DATA|NON_MASTER)
OPTS="$OPTS -E node.master=false -E node.data=true"
;;
*)
echo "Unknown node type. Please use MASTER|GATEWAY|DATA|NON_MASTER"
exit 1
esac
fi
}
pre_checks
if [ -f /conf/env ]; then
. /conf/env
fi
if [ ! -e /conf/elasticsearch.* ]; then
cp $ES_HOME/config/elasticsearch.yml /conf
fi
if [ ! -e /conf/log4j2.properties ]; then
cp $ES_HOME/config/log4j2.properties /conf
fi
OPTS="$OPTS \
-E path.conf=/conf \
-E path.data=/data \
-E path.logs=/data \
-E transport.tcp.port=9300 \
-E http.port=9200"
discoverAllGlobalIps
if [ "${DISCOVER_TRANSPORT_IP}" != "" ]; then
discoverIpFromLink $DISCOVER_TRANSPORT_IP transport
fi
if [ "${DISCOVER_HTTP_IP}" != "" ]; then
discoverIpFromLink $DISCOVER_HTTP_IP http
fi
setup_personality
setup_clustering
install_plugins
mkdir -p /conf/scripts
echo "Starting Elasticsearch with the options $OPTS"
CMD="$ES_HOME/bin/elasticsearch $OPTS"
if [ `id -u` = 0 ]; then
echo "Running as non-root..."
chown -R $DEFAULT_ES_USER /data /conf
su -c "$CMD" $DEFAULT_ES_USER
else
$CMD
fi

26
gitblit/Dockerfile Normal file
View File

@@ -0,0 +1,26 @@
FROM java:8
MAINTAINER itzg
ENV GITBLIT_VERSION 1.7.1
RUN wget -qO /tmp/gitblit.tgz http://dl.bintray.com/gitblit/releases/gitblit-$GITBLIT_VERSION.tar.gz
RUN tar -C /opt -xvf /tmp/gitblit.tgz && \
rm /tmp/gitblit.tgz
VOLUME ["/data"]
ADD start.sh /start
ENV GITBLIT_PATH=/opt/gitblit-${GITBLIT_VERSION} \
GITBLIT_HTTPS_PORT=443 \
GITBLIT_HTTP_PORT=80 \
GITBLIT_BASE_FOLDER=/data \
GITBLIT_ADMIN_USER=admin \
GITBLIT_INITIAL_REPO=
WORKDIR $GITBLIT_PATH
EXPOSE 80 443
ENTRYPOINT ["/start"]

46
gitblit/README.md Normal file
View File

@@ -0,0 +1,46 @@
Provides a ready-to-use instance of [GitBlit](http://gitblit.com/).
## Basic usage
Start the GitBlit container using
docker run -d -p 80:80 -p 443:443 --name gitblit itzg/gitblit
Access its web interface at the mapped HTTP (80) or HTTPS (443) port of the
Docker host. Login with the default credentials __admin__ / __admin__ .
## Data volume
In order to allow for future upgrades, run the container with a volume mount of `/data`, such as:
-v /tmp/gitblit-data:/data
## Initial repository creation
As a convenience for cluster configuration management with git
(such as with [Spring Cloud Config](https://cloud.spring.io/spring-cloud-config/)),
you may specify the name of an initial repository to be owned by the 'admin' user.
This can be enabled by passing the name of that repository via the environment
variable `GITBLIT_INITIAL_REPO`, such as
-e GITBLIT_INITIAL_REPO=default
## Create repositories with content
In addition to the approach above, you can push repostories with existing
content by attaching them to sub-directories of `/repos`, such as
docker run -v $HOME/git/example:/repos/example ...
## Custom configuration
You can add or override any of the `*.properties` files for configuring GitBlit,
typically `gitblit.properties`, by placing those files in a volume attached at
`/config`, such as
-v $(pwd)/extra-config:/config
The property files in that configuration directory will be renamed with the
suffix `.applied` to avoid overwriting manually modified configuration on
the next container startup.

103
gitblit/start.sh Executable file
View File

@@ -0,0 +1,103 @@
#!/bin/bash
apply_base_data() {
contents=`ls $GITBLIT_BASE_FOLDER|wc -l`
if [ $contents = "0" ]; then
cp -r $GITBLIT_PATH/data/* $GITBLIT_BASE_FOLDER
fi
}
apply_config() {
cp -rf /config/* $GITBLIT_BASE_FOLDER
}
create_repo() {
local repo_dir=$GITBLIT_BASE_FOLDER/git/$1.git
mkdir -p $repo_dir
cd $repo_dir
git init --bare
echo "
[gitblit]
description =
originRepository =
owner = $GITBLIT_ADMIN_USER
acceptNewPatchsets = true
acceptNewTickets = true
mergeTo = master
useIncrementalPushTags = false
allowForks = true
accessRestriction = PUSH
authorizationControl = AUTHENTICATED
verifyCommitter = false
showRemoteBranches = false
isFrozen = false
skipSizeCalculation = false
skipSummaryMetrics = false
federationStrategy = FEDERATE_THIS
isFederated = false
gcThreshold =
gcPeriod = 0
" >> config
git config --replace-all core.logallrefupdates false
echo "
CREATING repository '$1' with:
* read/clone access for all
* push access for authenticated users"
RET="file://$repo_dir"
}
apply_repos() {
for rdir in /repos/*; do
if [ -e $rdir/.git ]; then
r=$(basename $rdir)
create_repo $r
local url=$RET
cd $rdir
echo "* pushed existing content"
git push --all $url
fi
done
}
create_initial_repo() {
if [ -d $GITBLIT_INITIAL_REPO ]; then
return
fi
create_repo $GITBLIT_INITIAL_REPO
}
shopt -s nullglob
if [ ! -f /var/local/gitblit_firststart ]; then
FIRSTSTART=1
else
FIRSTSTART=0
fi
if [ $FIRSTSTART = 1 ]; then
apply_base_data
echo "
Applying configuration from /config
"
apply_config
touch /var/local/gitblit_firststart
fi
if [[ -n $GITBLIT_INITIAL_REPO ]]; then
create_initial_repo
fi
apply_repos
cd $GITBLIT_PATH
$JAVA_HOME/bin/java -jar $GITBLIT_PATH/gitblit.jar \
--httpsPort $GITBLIT_HTTPS_PORT --httpPort $GITBLIT_HTTP_PORT \
--baseFolder $GITBLIT_BASE_FOLDER

1
jekyll-github-pages/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/site

View File

@@ -0,0 +1,24 @@
FROM ubuntu:trusty
MAINTAINER itzg
ENV APT_GET_UPDATE 2014-09-18
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install ruby ruby-dev make patch nodejs
RUN gem install bundler
ADD Gemfile /tmp/Gemfile
WORKDIR /tmp
RUN bundle install
ADD template /site-template
VOLUME ["/site"]
EXPOSE 4000
ADD start.sh /start
CMD ["/start"]

View File

@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages'

View File

@@ -0,0 +1,14 @@
This container is pre-configured according to the
[GitHub Pages use of Jekyll](https://help.github.com/articles/using-jekyll-with-pages).
It serves up the generated content on port 4000 and the site is generated from
the container's `/site` volume. You can either bring your own site content or
let it generate some VERY simple content along with the standard Jekyll directory
layout.
A typical way to run this:
docker run -it -p 4000:4000 -v $(pwd)/site:/site itzg/jekyll-github-pages
where either it will load your content or initialize the content under
`site` in your current working directory.

13
jekyll-github-pages/start.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/sh
if [ `ls /site/index.* 2> /dev/null | wc -l` = 0 ]; then
echo "Preparing /site with default content..."
cp -r /site-template/* /site
fi
if [ ! -e /site/Gemfile ]; then
cp /tmp/Gemfile /site/Gemfile
fi
cd /site
bundle exec jekyll serve

View File

@@ -0,0 +1 @@
highlighter: pygments

View File

@@ -0,0 +1,3 @@
<footer>
<i>Goodbye</i>
</footer>

View File

@@ -0,0 +1,3 @@
<header>
<h1>{{ page.title }}</h1>
</header>

View File

@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ page.title }}</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>

View File

@@ -0,0 +1,12 @@
{% include top.html %}
<body>
{% include header.html %}
{{ content }}
{% include footer.html %}
</body>
</html>

View File

@@ -0,0 +1,6 @@
---
layout: default
title: Powered by Jekyll
overview: true
---
This is where the content goes.

17
jenkins/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM java:openjdk-8u102-jdk
MAINTAINER itzg
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
graphviz \
&& apt-get clean
ENV JENKINS_HOME=/data
VOLUME ["/data", "/root", "/opt/jenkins"]
EXPOSE 8080 38252
COPY download-and-start.sh /opt/download-and-start
CMD ["/opt/download-and-start"]

51
jenkins/README.md Normal file
View File

@@ -0,0 +1,51 @@
A self-upgrading [Jenkins CI](http://jenkins-ci.org/) server
# Basic Usage
To start Jenkins with the latest version:
ID=$(docker run -d -p 8080:8080 itzg/jenkins)
At a later time, you can upgrade by restarting the container:
docker stop $ID
docker start $ID
# Attaching host directory to Jenkins home directory
The Jenkins home directory is attachable at `/data`, so attaching to a host volume
would be:
ID=$(docker run -d -p 8080:8080 -v /SOME_HOST_DIR:/data itzg/jenkins
# Enabling Jenkins slave agents
By default, Jenkins will pick a random port to allow slave nodes launched
by JNLP. Since Docker networking is basically a firewall, a random port
won't work for us. Instead the fixed port **38252** was chosen (arbitrarily)
to be exposed by the container.
Launch your Jenkins container using
ID=$(docker run -d -p 8080:8080 -p 38252:38252 itzg/jenkins)
and configure the port in the Global Security settings:
![](http://i.imgur.com/PhQiEHy.png)
# Image Parameters
## Volumes
* `/data` - a majority of the Jenkins content is maintained here, such as workspaces
* `/root` - some tools, such as Maven, utilize the home directory for default repository storage
* `/opt/jenkins` - the installed distribution is expanded here
## Ports
* `8080` - for the web UI
* `38252` - for slave incoming JMX access
## Environment Variables
* `JENKINS_OPTS` - passed to the initial Java invocation of Jenkins

29
jenkins/download-and-start.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
mirrorUrl=http://mirrors.jenkins-ci.org/war/latest/jenkins.war
url=$(curl -s --head $mirrorUrl|awk -F': ' '$1 == "Location" { print $2 }' | sed 's/[[:space:]]*$//')
version=$(echo $url | sed 's#.*/war/\(.*\)/jenkins.war#\1#')
mkdir -p /opt/jenkins
trackingFile=/opt/jenkins/INSTALLED
installed=
if [ -f $trackingFile ]; then
installed=$(cat $trackingFile)
echo "Version installed is $installed"
fi
if [ $version != "$installed" ]; then
echo "Downloading $version from '$url'"
while ! curl -s -o /opt/jenkins/jenkins.war "$url"
do
echo "Trying again in 5 seconds"
sleep 5
done
echo $version > $trackingFile
fi
cd /opt/jenkins
exec java $JENKINS_OPTS -jar jenkins.war

22
kibana/Dockerfile Executable file
View File

@@ -0,0 +1,22 @@
FROM openjdk:8u111-jre
MAINTAINER itzg
ENV KIBANA_VERSION 5.1.2
ADD https://artifacts.elastic.co/downloads/kibana/kibana-${KIBANA_VERSION}-linux-x86_64.tar.gz /tmp/kibana.tgz
RUN tar -C /opt -xzf /tmp/kibana.tgz && rm /tmp/kibana.tgz
ENV KIBANA_HOME /opt/kibana-$KIBANA_VERSION-linux-x86_64
# Simplify for cross-container
ENV ES_URL http://es:9200
WORKDIR $KIBANA_HOME
ADD start.sh /start
EXPOSE 5601
CMD ["/start"]

26
kibana/README.md Normal file
View File

@@ -0,0 +1,26 @@
Provides a ready-to-run [Kibana](http://www.elasticsearch.org/overview/kibana/) server that can
easily hook into your [Elasticsearch containers](https://registry.hub.docker.com/u/itzg/elasticsearch/).
## Usage with Docker elasticsearch container
This is by far the easiest and most Docker'ish way to run Kibana.
Assuming you started one or more containers using something like
docker run -d --name your-es -p 9200:9200 itzg/elasticsearch
Start Kibana using
docker run -d -p 5601:5601 --link your-es:es itzg/kibana
Proceed to use Kibana starting from
[this point in the documentation](http://www.elasticsearch.org/guide/en/kibana/current/access.html)
## Usage with non-Docker elasticsearch
Start Kibana using
docker run -d -p 5601:5601 -e ES_URL=http://YOUR_ES:9200 itzg/kibana
Replacing `http://YOUR_ES:9200` with the appropriate URL for your system.

View File

@@ -0,0 +1,12 @@
version: '2'
services:
es:
build: ../elasticsearch
ports:
- "9200:9200"
kibana:
build: .
ports:
- "5601:5601"

5
kibana/start.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/sh
OPTS="-e $ES_URL -H $HOSTNAME"
exec bin/kibana $OPTS

25
logstash/Dockerfile Executable file
View File

@@ -0,0 +1,25 @@
FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
ENV LOGSTASH_VERSION 1.5.0-1
RUN wget -qO /tmp/logstash.deb http://download.elastic.co/logstash/logstash/packages/debian/logstash_${LOGSTASH_VERSION}_all.deb
RUN dpkg -i /tmp/logstash.deb && rm /tmp/logstash.deb
WORKDIR /opt/logstash
# For collectd reception
EXPOSE 25826
# /conf is the default directory where our logstash will read pipeline config files
# /logs is an optional attach point to reference something like /var/log on the host
VOLUME ["/conf","/logs"]
ENV PLUGIN_UPDATES 2015-06-10
RUN bin/plugin install logstash-input-heartbeat
RUN bin/plugin install logstash-output-elasticsearch_groom
CMD ["bin/logstash","agent","-f","/conf"]

44
logstash/README.md Normal file
View File

@@ -0,0 +1,44 @@
This image bundles the latest (1.5.x) version of Logstash with the ability to
groom its own Elasticsearch indices.
# Basic Usage
To start a Logstash container, setup a directory on your host with one or more Logstash
pipeline configurations files, called `$HOST_CONF` here, and run
docker run -d -v $HOST_CONF:/conf itzg/logstash
# Accessing host logs
Logstash is much more useful when it is actually processing...logs. Logs inside the container
are non-existent, but you can attach the host machine's `/var/log` directory via the container's
`/logs` volume:
docker run ... -v /var/log:/logs ...
Keep in mind you will need to configure `file` inputs with a base path of `/logs`, such as
```
file {
path => ['/logs/syslog']
type => 'syslog'
}
```
# Receiving input from collectd
To allow for incoming [collectd](https://collectd.org/) content, **UDP** port 25826 is exposed and
can be mapped onto the host using:
docker run ... -p 25826:25826/udp
Regardless of the host port, be sure to configure the logstash input to bind at port `25826`, such
as
```
udp {
port => 25826
codec => collectd { }
buffer_size => 1452
}
```

View File

@@ -0,0 +1,25 @@
input {
heartbeat {
type => 'groom'
interval => 11
add_field => {
scope => 'open'
cutoff => '4w'
action => 'close'
}
}
}
output {
if [type] == 'groom' {
elasticsearch_groom {
host => 'es:9200'
index => 'logstash-%{+YYYY.MM.dd}'
scope => '%{scope}'
age_cutoff => '%{cutoff}'
action => '%{action}'
}
}
}

View File

@@ -0,0 +1 @@
data

1
minecraft-server/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/data/

View File

@@ -1,25 +1,43 @@
FROM itzg/ubuntu-openjdk-7
FROM openjdk:8-jre
MAINTAINER itzg
ENV APT_GET_UPDATE 2016-04-23
RUN apt-get update
RUN apt-get install -y wget libmozjs-24-bin
RUN update-alternatives --install /usr/bin/js js /usr/bin/js24 100
RUN wget -O /usr/bin/jsawk https://github.com/micha/jsawk/raw/master/jsawk
RUN chmod +x /usr/bin/jsawk
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
imagemagick \
lsof \
nano \
sudo \
vim \
jq \
&& apt-get clean
EXPOSE 25565
RUN useradd -s /bin/false --uid 1000 minecraft \
&& mkdir /data \
&& mkdir /config \
&& mkdir /mods \
&& mkdir /plugins \
&& mkdir /home/minecraft \
&& chown minecraft:minecraft /data /config /mods /plugins /home/minecraft
ADD run.sh /run
EXPOSE 25565 25575
VOLUME ['/data']
ADD server.properties /tmp/server.properties
ADD https://github.com/itzg/restify/releases/download/1.0.3/restify_linux_amd64 /usr/local/bin/restify
COPY start.sh /start
COPY start-minecraft.sh /start-minecraft
COPY mcadmin.jq /usr/share
RUN chmod +x /usr/local/bin/*
VOLUME ["/data","/mods","/config","/plugins","/home/minecraft"]
COPY server.properties /tmp/server.properties
WORKDIR /data
ENTRYPOINT /run
ENTRYPOINT [ "/start" ]
ENV MOTD A Minecraft Server Powered by Docker
ENV LEVEL world
ENV JVM_OPTS -Xmx512M -Xms512M
ENV VERSION 1.7.9
ENV UID=1000 GID=1000 \
MOTD="A Minecraft Server Powered by Docker" \
JVM_OPTS="-Xmx1024M -Xms1024M" \
TYPE=VANILLA VERSION=LATEST FORGEVERSION=RECOMMENDED LEVEL=world PVP=true DIFFICULTY=easy \
LEVEL_TYPE=DEFAULT GENERATOR_SETTINGS= WORLD= MODPACK= ONLINE_MODE=TRUE CONSOLE=true

View File

@@ -1,29 +1,618 @@
This docker image provides a Minecraft Server that will automatically download the latest stable, latest snapshot, or any specific server version.
[![Docker Pulls](https://img.shields.io/docker/pulls/itzg/minecraft-server.svg)](https://hub.docker.com/r/itzg/minecraft-server/)
[![Docker Stars](https://img.shields.io/docker/stars/itzg/minecraft-server.svg?maxAge=2592000)](https://hub.docker.com/r/itzg/minecraft-server/)
This docker image provides a Minecraft Server that will automatically download the latest stable
version at startup. You can also run/upgrade to any specific version or the
latest snapshot. See the *Versions* section below for more information.
To simply use the latest stable version, run
docker run -d -p 25565:25565 minecraft-server
where the default server port, 25565, will be exposed on your host machine.
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
In order to persist the Minecraft data, which you *probably want to do for a real server setup*, use the `-v` argument to map a local path to the `/data' path in the container, such as
where the standard server port, 25565, will be exposed on your host machine.
docker run -d -v /path/on/host:/data -p 25565:25565 minecraft-server
If you want to serve up multiple Minecraft servers or just use an alternate port,
change the host-side port mapping such as
docker run -p 25566:25565 ...
will serve your Minecraft server on your host's port 25566 since the `-p` syntax is
`host-port`:`container-port`.
Speaking of multiple servers, it's handy to give your containers explicit names using `--name`, such as
docker run -d -p 25565:25565 --name mc itzg/minecraft-server
With that you can easily view the logs, stop, or re-start the container:
docker logs -f mc
( Ctrl-C to exit logs action )
docker stop mc
docker start mc
## Interacting with the server
In order to attach and interact with the Minecraft server, add `-it` when starting the container, such as
docker run -d -it -p 25565:25565 --name mc itzg/minecraft-server
With that you can attach and interact at any time using
docker attach mc
and then Control-p Control-q to **detach**.
For remote access, configure your Docker daemon to use a `tcp` socket (such as `-H tcp://0.0.0.0:2375`)
and attach from another machine:
docker -H $HOST:2375 attach mc
Unless you're on a home/private LAN, you should [enable TLS access](https://docs.docker.com/articles/https/).
## EULA Support
Mojang now requires accepting the [Minecraft EULA](https://account.mojang.com/documents/minecraft_eula). To accept add
-e EULA=TRUE
such as
docker run -d -it -e EULA=TRUE -p 25565:25565 --name mc itzg/minecraft-server
## Attaching data directory to host filesystem
In order to readily access the Minecraft data, use the `-v` argument
to map a directory on your host machine to the container's `/data` directory, such as:
docker run -d -v /path/on/host:/data ...
When attached in this way you can stop the server, edit the configuration under your attached `/path/on/host`
and start the server again with `docker start CONTAINERID` to pick up the new configuration.
**NOTE**: By default, the files in the attached directory will be owned by the host user with UID of 1000 and host group with GID of 1000.
You can use an different UID and GID by passing the options:
-e UID=1000 -e GID=1000
replacing 1000 with a UID and GID that is present on the host.
Here is one way to find the UID and GID:
id some_host_user
getent group some_host_group
## Versions
To use a different Minecraft version, pass the `VERSION` environment variable, which can have the value
* LATEST
* SNAPSHOT
* (or a specific version, such as "1.7.9")
For example, to use the latest snapshot:
docker run -d -e VERSION=SNAPSHOT -p 25565:25565 minecraft-server
docker run -d -e VERSION=SNAPSHOT ...
or a specific version:
docker run -d -e VERSION=1.7.9 -p 25565:25565 minecraft-server
docker run -d -e VERSION=1.7.9 ...
## Running a Forge Server
Enable Forge server mode by adding a `-e TYPE=FORGE` to your command-line.
By default the container will run the `RECOMMENDED` version of [Forge server](http://www.minecraftforge.net/wiki/)
but you can also choose to run a specific version with `-e FORGEVERSION=10.13.4.1448`.
$ docker run -d -v /path/on/host:/data -e VERSION=1.7.10 \
-e TYPE=FORGE -e FORGEVERSION=10.13.4.1448 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
In order to add mods, you have two options.
### Using the /data volume
This is the easiest way if you are using a persistent `/data` mount.
To do this, you will need to attach the container's `/data` directory
(see "Attaching data directory to host filesystem”).
Then, you can add mods to the `/path/on/host/mods` folder you chose. From the example above,
the `/path/on/host` folder contents look like:
```
/path/on/host
├── mods
│   └── ... INSTALL MODS HERE ...
├── config
│   └── ... CONFIGURE MODS HERE ...
├── ops.json
├── server.properties
├── whitelist.json
└── ...
```
If you add mods while the container is running, you'll need to restart it to pick those
up:
docker stop mc
docker start mc
### Using separate mounts
This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option.
There are two additional volumes that can be mounted; `/mods` and `/config`.
Any files in either of these filesystems will be copied over to the main
`/data` filesystem before starting Minecraft.
This works well if you want to have a common set of modules in a separate
location, but still have multiple worlds with different server requirements
in either persistent volumes or a downloadable archive.
## Running a Bukkit/Spigot server
Enable Bukkit/Spigot server mode by adding a `-e TYPE=BUKKIT -e VERSION=1.8` or `-e TYPE=SPIGOT -e VERSION=1.8` to your command-line.
docker run -d -v /path/on/host:/data \
-e TYPE=SPIGOT -e VERSION=1.8 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
You can build spigot from source by adding `-e BUILD_FROM_SOURCE=true`
__NOTE: to avoid pegging the CPU when running Spigot,__ you will need to
pass `--noconsole` at the very end of the command line and not use `-it`. For example,
docker run -d -v /path/on/host:/data \
-e TYPE=SPIGOT -e VERSION=1.8 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
You can install Bukkit plugins in two ways...
### Using the /data volume
This is the easiest way if you are using a persistent `/data` mount.
To do this, you will need to attach the container's `/data` directory
(see "Attaching data directory to host filesystem”).
Then, you can add plugins to the `/path/on/host/plugins` folder you chose. From the example above,
the `/path/on/host` folder contents look like:
```
/path/on/host
├── plugins
│   └── ... INSTALL PLUGINS HERE ...
├── ops.json
├── server.properties
├── whitelist.json
└── ...
```
If you add plugins while the container is running, you'll need to restart it to pick those
up:
docker stop mc
docker start mc
### Using separate mounts
This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option.
There is one additional volume that can be mounted; `/plugins`.
Any files in this filesystem will be copied over to the main
`/data/plugins` filesystem before starting Minecraft.
This works well if you want to have a common set of plugins in a separate
location, but still have multiple worlds with different server requirements
in either persistent volumes or a downloadable archive.
## Running a PaperSpigot server
Enable PaperSpigot server mode by adding a `-e TYPE=PAPER -e VERSION=1.9.4` to your command-line.
docker run -d -v /path/on/host:/data \
-e TYPE=PAPER -e VERSION=1.9.4 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
__NOTE: to avoid pegging the CPU when running PaperSpigot,__ you will need to
pass `--noconsole` at the very end of the command line and not use `-it`. For example,
docker run -d -v /path/on/host:/data \
-e TYPE=PAPER -e VERSION=1.9.4 \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server --noconsole
You can install Bukkit plugins in two ways...
### Using the /data volume
This is the easiest way if you are using a persistent `/data` mount.
To do this, you will need to attach the container's `/data` directory
(see "Attaching data directory to host filesystem”).
Then, you can add plugins to the `/path/on/host/plugins` folder you chose. From the example above,
the `/path/on/host` folder contents look like:
```
/path/on/host
├── plugins
│   └── ... INSTALL PLUGINS HERE ...
├── ops.json
├── server.properties
├── whitelist.json
└── ...
```
If you add plugins while the container is running, you'll need to restart it to pick those
up:
docker stop mc
docker start mc
### Using separate mounts
This is the easiest way if you are using an ephemeral `/data` filesystem,
or downloading a world with the `WORLD` option.
There is one additional volume that can be mounted; `/plugins`.
Any files in this filesystem will be copied over to the main
`/data/plugins` filesystem before starting Minecraft.
This works well if you want to have a common set of plugins in a separate
location, but still have multiple worlds with different server requirements
in either persistent volumes or a downloadable archive.
## Running a Server with a Feed-The-Beast (FTB) modpack
Enable this server mode by adding a `-e TYPE=FTB` to your command-line,
but note the following additional steps needed...
You need to specify a modpack to run, using the `FTB_SERVER_MOD` environment
variable. An FTB server modpack is available together with its respective
client modpack on https://www.feed-the-beast.com under "Additional Files."
Because of the interactive delayed download mechanism on that web site, you
must manually download the server modpack. Copy the modpack to the `/data`
directory (see "Attaching data directory to host filesystem”).
Now you can add a `-e FTB_SERVER_MOD=name_of_modpack.zip` to your command-line.
$ docker run -d -v /path/on/host:/data -e TYPE=FTB \
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
### Using the /data volume
You must use a persistent `/data` mount for this type of server.
To do this, you will need to attach the container's `/data` directory
(see "Attaching data directory to host filesystem”).
If the modpack is updated and you want to run the new version on your
server, you stop and remove the container:
docker stop mc
docker rm mc
Do not erase anything from your /data directory (unless you know of
specific mods that have been removed from the modpack). Download the
updated FTB server modpack and copy it to `/data`. Start a new container
with `FTB_SERVER_MOD` specifying the updated modpack file.
$ docker run -d -v /path/on/host:/data -e TYPE=FTB \
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.7.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
### FTB server JVM options
An FTB server modpack contains its own startup script that launches the
JVM and it does not use the `JVM_OPTS` environment variable. Instead
you can use `MIN_RAM` and `MAX_RAM` variables. These are appended to
the JVM `-Xms` and `-Xmx` options. For example, `-e MIN_RAM=2G` results
in `-Xms2G` passed to the JVM.
Additionally, `PERMGEN_SIZE` is passed on to `-XX:PermSize`. Here is an
example:
$ docker run -d -v /path/on/host:/data -e TYPE=FTB \
-e MIN_RAM=1G -e MAX_RAM=2G -e PERMGEN_SIZE=512M \
-e FTB_SERVER_MOD=FTBPresentsSkyfactory3Server_3.0.6.zip \
-p 25565:25565 -e EULA=TRUE --name mc itzg/minecraft-server
Note: The FTB server start script will also override other options,
like `MOTD`.
## Using Docker Compose
Rather than type the server options below, the port mappings above, etc
every time you want to create new Minecraft server, you can now use
[Docker Compose](https://docs.docker.com/compose/). Start with a
`docker-compose.yml` file like the following:
```
minecraft-server:
ports:
- "25565:25565"
environment:
EULA: "TRUE"
image: itzg/minecraft-server
container_name: mc
tty: true
stdin_open: true
restart: always
```
and in the same directory as that file run
docker-compose -d up
Now, go play...or adjust the `environment` section to configure
this server instance.
## Server configuration
### Difficulty
The difficulty level (default: `easy`) can be set like:
docker run -d -e DIFFICULTY=hard ...
Valid values are: `peaceful`, `easy`, `normal`, and `hard`, and an
error message will be output in the logs if it's not one of these
values.
### Whitelist Players
To whitelist players for your Minecraft server, pass the Minecraft usernames separated by commas via the `WHITELIST` environment variable, such as
docker run -d -e WHITELIST=user1,user2 ...
If the `WHITELIST` environment variable is not used, any user can join your Minecraft server if it's publicly accessible.
### Op/Administrator Players
To add more "op" (aka adminstrator) users to your Minecraft server, pass the Minecraft usernames separated by commas via the `OPS` environment variable, such as
docker run -d -e OPS=user1,user2 ...
### Server icon
A server icon can be configured using the `ICON` variable. The image will be automatically
downloaded, scaled, and converted from any other image format:
docker run -d -e ICON=http://..../some/image.png ...
### Rcon
To use rcon use the `ENABLE_RCON` and `RCON_PASSORD` variables.
By default rcon port will be `25575` but can easily be changed with the `RCON_PORT` variable.
docker run -d -e ENABLE_RCON=true -e RCON_PASSWORD=testing
### Query
Enabling this will enable the gamespy query protocol.
By default the query port will be `25565` (UDP) but can easily be changed with the `QUERY_PORT` variable.
docker run -d -e ENABLE_QUERY=true
### Max players
By default max players is 20, you can increase this with the `MAX_PLAYERS` variable.
docker run -d -e MAX_PLAYERS=50
### Max world size
This sets the maximum possible size in blocks, expressed as a radius, that the world border can obtain.
docker run -d -e MAX_WORLD_SIZE=10000
### Allow Nether
Allows players to travel to the Nether.
docker run -d -e ALLOW_NETHER=true
### Announce Player Achievements
Allows server to announce when a player gets an achievement.
docker run -d -e ANNOUNCE_PLAYER_ACHIEVEMENTS=true
### Enable Command Block
Enables command blocks
docker run -d -e ENABLE_COMMAND_BLOCK=true
### Force Gamemode
Force players to join in the default game mode.
* false - Players will join in the gamemode they left in.
* true - Players will always join in the default gamemode.
`docker run -d -e FORCE_GAMEMODE=false`
### Generate Structures
Defines whether structures (such as villages) will be generated.
* false - Structures will not be generated in new chunks.
* true - Structures will be generated in new chunks.
`docker run -d -e GENERATE_STRUCTURES=true`
### Hardcore
If set to true, players will be set to spectator mode if they die.
docker run -d -e HARDCORE=false
### Max Build Height
The maximum height in which building is allowed.
Terrain may still naturally generate above a low height limit.
docker run -d -e MAX_BUILD_HEIGHT=256
### Max Tick Time
The maximum number of milliseconds a single tick may take before the server watchdog stops the server with the message, A single server tick took 60.00 seconds (should be max 0.05); Considering it to be crashed, server will forcibly shutdown. Once this criteria is met, it calls System.exit(1).
Setting this to -1 will disable watchdog entirely
docker run -d -e MAX_TICK_TIME=60000
### Spawn Animals
Determines if animals will be able to spawn.
docker run -d -e SPAWN_ANIMALS=true
### Spawn Monsters
Determines if monsters will be spawned.
docker run -d -e SPAWN_MONSTERS=true
### Spawn NPCs
Determines if villagers will be spawned.
docker run -d -e SPAWN_NPCS=true
### View Distance
Sets the amount of world data the server sends the client, measured in chunks in each direction of the player (radius, not diameter).
It determines the server-side viewing distance.
docker run -d -e VIEW_DISTANCE=10
### Level Seed
If you want to create the Minecraft level with a specific seed, use `SEED`, such as
docker run -d -e SEED=1785852800490497919 ...
### Game Mode
By default, Minecraft servers are configured to run in Survival mode. You can
change the mode using `MODE` where you can either provide the [standard
numerical values](http://minecraft.gamepedia.com/Game_mode#Game_modes) or the
shortcut values:
* creative
* survival
* adventure
* spectator (only for Minecraft 1.8 or later)
For example:
docker run -d -e MODE=creative ...
### Message of the Day
The message of the day, shown below each server entry in the UI, can be changed with the `MOTD` environment variable, such as
docker run -d -e 'MOTD=My Server' -p 25565:25565 minecraft-server
docker run -d -e 'MOTD=My Server' ...
If you leave it off, the last used or default message will be used. _The example shows how to specify a server
message of the day that contains spaces by putting quotes around the whole thing._
### PVP Mode
By default, servers are created with player-vs-player (PVP) mode enabled. You can disable this with the `PVP`
environment variable set to `false`, such as
docker run -d -e PVP=false ...
### Level Type and Generator Settings
By default, a standard world is generated with hills, valleys, water, etc. A different level type can
be configured by setting `LEVEL_TYPE` to
* DEFAULT
* FLAT
* LARGEBIOMES
* AMPLIFIED
* CUSTOMIZED
Descriptions are available at the [gamepedia](http://minecraft.gamepedia.com/Server.properties).
When using a level type of `FLAT` and `CUSTOMIZED`, you can further configure the world generator
by passing [custom generator settings](http://minecraft.gamepedia.com/Superflat).
**Since generator settings usually have ;'s in them, surround the -e value with a single quote, like below.**
For example (just the `-e` bits):
-e LEVEL_TYPE=flat -e 'GENERATOR_SETTINGS=3;minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone;2;'
### World Save Name
You can either switch between world saves or run multiple containers with different saves by using the `LEVEL` option,
where the default is "world":
docker run -d -e LEVEL=bonus ...
**NOTE:** if running multiple containers be sure to either specify a different `-v` host directory for each
`LEVEL` in use or don't use `-v` and the container's filesystem will keep things encapsulated.
### Downloadable world
Instead of mounting the `/data` volume, you can instead specify the URL of
a ZIP file containing an archived world. This will be downloaded, and
unpacked in the `/data` directory; if it does not contain a subdirectory
called `world/` then it will be searched for a file `level.dat` and the
containing subdirectory renamed to `world`. This means that most of the
archived Minecraft worlds downloadable from the Internet will already be in
the correct format.
The ZIP file may also contain a `server.properties` file and `modules`
directory, if required.
docker run -d -e WORLD=http://www.example.com/worlds/MySave.zip ...
**NOTE:** Unless you also mount `/data` as an external volume, this world
will be deleted when the container is deleted.
**NOTE:** This URL must be accessible from inside the container. Therefore,
you should use an IP address or a globally resolveable FQDN, or else the
name of a linked container.
### Downloadable mod/plugin pack for Forge, Bukkit, and Spigot Servers
Like the `WORLD` option above, you can specify the URL of a "mod pack"
to download and install into `mods` for Forge or `plugins` for Bukkit/Spigot.
To use this option pass the environment variable `MODPACK`, such as
docker run -d -e MODPACK=http://www.example.com/mods/modpack.zip ...
**NOTE:** The referenced URL must be a zip file with one or more jar files at the
top level of the zip archive. Make sure the jars are compatible with the
particular `TYPE` of server you are running.
### Online mode
By default, server checks connecting players against Minecraft's account database. If you want to create an offline server or your server is not connected to the internet, you can disable the server to try connecting to minecraft.net to authenticate players with environment variable `ONLINE_MODE`, like this
docker run -d -e ONLINE_MODE=FALSE ...
## Miscellaneous Options
### Memory Limit
The Java memory limit can be adjusted using the `JVM_OPTS` environment variable, where the default is
the setting shown in the example (max and min at 1024 MB):
docker run -e 'JVM_OPTS=-Xmx1024M -Xms1024M' ...
### /data ownership
In order to adapt to differences in `UID` and `GID` settings the entry script will attempt to correct ownership and writability of the `/data` directory. This logic can be disabled by setting `-e SKIP_OWNERSHIP_FIX=TRUE`.

View File

@@ -0,0 +1,14 @@
minecraft-server:
ports:
- "25565:25565"
environment:
EULA: "TRUE"
image: itzg/minecraft-server
container_name: minecraft-server
tty: true
stdin_open: true
restart: always

View File

@@ -0,0 +1,7 @@
.[] |
select(.elements | length > 1) |
select(.elements[].elements[] | select(.class == "version" and .text == $version)) |
.elements[].elements[] |
select(.class|contains("server-jar")) |
.elements[] | select(.name="a") |
.href

View File

@@ -1,26 +0,0 @@
#!/bin/sh
case $VERSION in
LATEST)
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
;;
SNAPSHOT)
export VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
;;
esac
cd /data
if [ ! -e minecraft_server.$VERSION.jar ]; then
wget https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar
fi
if [ ! -e server.properties ]; then
cp /tmp/server.properties .
fi
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
java $JVM_OPTS -jar minecraft_server.$VERSION.jar

View File

@@ -5,11 +5,14 @@ enable-query=false
allow-flight=false
announce-player-achievements=true
server-port=25565
rcon.port=25575
query.port=25565
level-type=DEFAULT
enable-rcon=false
force-gamemode=false
level-seed=
server-ip=
max-tick-time=60000
max-build-height=256
spawn-npcs=true
white-list=false
@@ -21,7 +24,7 @@ online-mode=true
resource-pack=
pvp=true
difficulty=1
enable-command-block=false
enable-command-block=true
player-idle-timeout=0
gamemode=0
max-players=20
@@ -29,5 +32,7 @@ spawn-monsters=true
generate-structures=true
view-distance=10
spawn-protection=16
motd=A Minecraft Server
motd=A Minecraft Server powered by Docker
generator-settings=
rcon.password=
max-world-size=29999984

View File

@@ -0,0 +1,504 @@
#!/bin/bash
#umask 002
export HOME=/data
if [ ! -e /data/eula.txt ]; then
if [ "$EULA" != "" ]; then
echo "# Generated via Docker on $(date)" > eula.txt
echo "eula=$EULA" >> eula.txt
else
echo ""
echo "Please accept the Minecraft EULA at"
echo " https://account.mojang.com/documents/minecraft_eula"
echo "by adding the following immediately after 'docker run':"
echo " -e EULA=TRUE"
echo ""
exit 1
fi
fi
VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json
echo "Checking version information."
case "X$VERSION" in
X|XLATEST|Xlatest)
VANILLA_VERSION=`curl -sSL $VERSIONS_JSON | jq -r '.latest.release'`
;;
XSNAPSHOT|Xsnapshot)
VANILLA_VERSION=`curl -sSL $VERSIONS_JSON | jq -r '.latest.snapshot'`
;;
X[1-9]*)
VANILLA_VERSION=$VERSION
;;
*)
VANILLA_VERSION=`curl -sSL $VERSIONS_JSON | jq -r '.latest.release'`
;;
esac
cd /data
function buildSpigotFromSource {
echo "Building Spigot $VANILLA_VERSION from source, might take a while, get some coffee"
mkdir /data/temp
cd /data/temp
wget -q -P /data/temp https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && \
java -jar /data/temp/BuildTools.jar --rev $VANILLA_VERSION 2>&1 |tee /data/spigot_build.log| while read l; do echo -n .; done; echo "done"
mv spigot-*.jar /data/spigot_server.jar
mv craftbukkit-*.jar /data/craftbukkit_server.jar
echo "Cleaning up"
rm -rf /data/temp
cd /data
}
function downloadSpigot {
local match
case "$TYPE" in
*BUKKIT|*bukkit)
match="Craftbukkit"
;;
*)
match="Spigot"
;;
esac
downloadUrl=$(restify --class=jar-div https://mcadmin.net/ | \
jq --arg version "$match $VANILLA_VERSION" -r -f /usr/share/mcadmin.jq)
if [[ -n $downloadUrl ]]; then
echo "Downloading $match"
wget -q -O $SERVER "$downloadUrl"
status=$?
if [ $status != 0 ]; then
echo "ERROR: failed to download from $downloadUrl due to (error code was $status)"
exit 3
fi
else
echo "ERROR: Version $VANILLA_VERSION is not supported for $TYPE"
echo " Refer to https://mcadmin.net/ for supported versions"
exit 2
fi
}
function downloadPaper {
local build
case "$VERSION" in
latest|LATEST|1.10)
build="lastSuccessfulBuild";;
1.9.4)
build="773";;
1.9.2)
build="727";;
1.9)
build="612";;
1.8.8)
build="443";;
*)
build="nosupp";;
esac
if [ $build != "nosupp" ]; then
downloadUrl="https://ci.destroystokyo.com/job/PaperSpigot/$build/artifact/paperclip.jar"
wget -q -O $SERVER "$downloadUrl"
status=$?
if [ $status != 0 ]; then
echo "ERROR: failed to download from $downloadUrl due to (error code was $status)"
exit 3
fi
else
echo "ERROR: Version $VERSION is not supported for $TYPE"
echo " Refer to https://ci.destroystokyo.com/job/PaperSpigot/"
echo " for supported versions"
exit 2
fi
}
function installForge {
TYPE=FORGE
norm=$VANILLA_VERSION
echo "Checking Forge version information."
case $FORGEVERSION in
RECOMMENDED)
curl -o /tmp/forge.json -sSL http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-recommended\"]")
if [ $FORGE_VERSION = null ]; then
FORGE_VERSION=$(cat /tmp/forge.json | jq -r ".promos[\"$norm-latest\"]")
if [ $FORGE_VERSION = null ]; then
echo "ERROR: Version $FORGE_VERSION is not supported by Forge"
echo " Refer to http://files.minecraftforge.net/ for supported versions"
exit 2
fi
fi
;;
*)
FORGE_VERSION=$FORGEVERSION
;;
esac
# URL format changed for 1.7.10 from 10.13.2.1300
sorted=$((echo $FORGE_VERSION; echo 10.13.2.1300) | sort -V | head -1)
if [[ $norm == '1.7.10' && $sorted == '10.13.2.1300' ]]; then
# if $FORGEVERSION >= 10.13.2.1300
normForgeVersion="$norm-$FORGE_VERSION-$norm"
else
normForgeVersion="$norm-$FORGE_VERSION"
fi
FORGE_INSTALLER="forge-$normForgeVersion-installer.jar"
SERVER="forge-$normForgeVersion-universal.jar"
if [ ! -e "$SERVER" ]; then
echo "Downloading $FORGE_INSTALLER ..."
wget -q http://files.minecraftforge.net/maven/net/minecraftforge/forge/$normForgeVersion/$FORGE_INSTALLER
echo "Installing $SERVER"
java -jar $FORGE_INSTALLER --installServer
fi
}
function installFTB {
TYPE=FEED-THE-BEAST
echo "Looking for Feed-The-Beast server modpack."
if [[ -z $FTB_SERVER_MOD ]]; then
echo "Environment variable FTB_SERVER_MOD not set."
echo "Set FTB_SERVER_MOD to the file name of the FTB server modpack."
echo "(And place the modpack in the /data directory.)"
exit 2
fi
local srv_modpack=${FTB_SERVER_MOD}
if [[ ${srv_modpack:0:5} == "data/" ]]; then
# Prepend with "/"
srv_modpack=/${srv_modpack}
fi
if [[ ! ${srv_modpack:0:1} == "/" ]]; then
# If not an absolute path, assume file is in "/data"
srv_modpack=/data/${srv_modpack}
fi
if [[ ! -f ${srv_modpack} ]]; then
echo "FTB server modpack ${srv_modpack} not found."
exit 2
fi
if [[ ! ${srv_modpack: -4} == ".zip" ]]; then
echo "FTB server modpack ${srv_modpack} is not a zip archive."
echo "Please set FTB_SERVER_MOD to a file with a .zip extension."
exit 2
fi
echo "Unpacking FTB server modpack ${srv_modpack} ..."
local ftb_dir=/data/FeedTheBeast
mkdir -p ${ftb_dir}
unzip -u -o ${srv_modpack} -d ${ftb_dir}
cp -f /data/eula.txt ${ftb_dir}/eula.txt
FTB_SERVER_START=${ftb_dir}/ServerStart.sh
chmod a+x ${FTB_SERVER_START}
}
function installVanilla {
SERVER="minecraft_server.$VANILLA_VERSION.jar"
if [ ! -e $SERVER ]; then
echo "Downloading $SERVER ..."
wget -q https://s3.amazonaws.com/Minecraft.Download/versions/$VANILLA_VERSION/$SERVER
fi
}
echo "Checking type information."
case "$TYPE" in
*BUKKIT|*bukkit|SPIGOT|spigot)
case "$TYPE" in
*BUKKIT|*bukkit)
SERVER=craftbukkit_server.jar
;;
*)
SERVER=spigot_server.jar
;;
esac
if [ ! -f $SERVER ]; then
if [[ "$BUILD_SPIGOT_FROM_SOURCE" = TRUE || "$BUILD_SPIGOT_FROM_SOURCE" = true || "$BUILD_FROM_SOURCE" = TRUE || "$BUILD_FROM_SOURCE" = true ]]; then
buildSpigotFromSource
else
downloadSpigot
fi
fi
# normalize on Spigot for operations below
TYPE=SPIGOT
;;
PAPER|paper)
SERVER=paper_server.jar
if [ ! -f $SERVER ]; then
downloadPaper
fi
# normalize on Spigot for operations below
TYPE=SPIGOT
;;
FORGE|forge)
TYPE=FORGE
installForge
;;
FTB|ftb)
TYPE=FEED-THE-BEAST
installFTB
;;
VANILLA|vanilla)
installVanilla
;;
*)
echo "Invalid type: '$TYPE'"
echo "Must be: VANILLA, FORGE, SPIGOT"
exit 1
;;
esac
# If supplied with a URL for a world, download it and unpack
if [[ "$WORLD" ]]; then
case "X$WORLD" in
X[Hh][Tt][Tt][Pp]*)
echo "Downloading world via HTTP"
echo "$WORLD"
wget -q -O - "$WORLD" > /data/world.zip
echo "Unzipping word"
unzip -q /data/world.zip
rm -f /data/world.zip
if [ ! -d /data/world ]; then
echo World directory not found
for i in /data/*/level.dat; do
if [ -f "$i" ]; then
d=`dirname "$i"`
echo Renaming world directory from $d
mv -f "$d" /data/world
fi
done
fi
if [ "$TYPE" = "SPIGOT" ]; then
# Reorganise if a Spigot server
echo "Moving End and Nether maps to Spigot location"
[ -d "/data/world/DIM1" ] && mv -f "/data/world/DIM1" "/data/world_the_end"
[ -d "/data/world/DIM-1" ] && mv -f "/data/world/DIM-1" "/data/world_nether"
fi
;;
*)
echo "Invalid URL given for world: Must be HTTP or HTTPS and a ZIP file"
;;
esac
fi
# If supplied with a URL for a modpack (simple zip of jars), download it and unpack
if [[ "$MODPACK" ]]; then
case "X$MODPACK" in
X[Hh][Tt][Tt][Pp]*[Zz][iI][pP])
echo "Downloading mod/plugin pack via HTTP"
echo "$MODPACK"
wget -q -O /tmp/modpack.zip "$MODPACK"
if [ "$TYPE" = "SPIGOT" ]; then
mkdir -p /data/plugins
unzip -o -d /data/plugins /tmp/modpack.zip
else
mkdir -p /data/mods
unzip -o -d /data/mods /tmp/modpack.zip
fi
rm -f /tmp/modpack.zip
;;
*)
echo "Invalid URL given for modpack: Must be HTTP or HTTPS and a ZIP file"
;;
esac
fi
function setServerProp {
local prop=$1
local var=$2
if [ -n "$var" ]; then
echo "Setting $prop to $var"
sed -i "/$prop\s*=/ c $prop=$var" /data/server.properties
fi
}
if [ ! -e server.properties ]; then
echo "Creating server.properties"
cp /tmp/server.properties .
if [ -n "$WHITELIST" ]; then
echo "Creating whitelist"
sed -i "/whitelist\s*=/ c whitelist=true" /data/server.properties
sed -i "/white-list\s*=/ c white-list=true" /data/server.properties
fi
setServerProp "motd" "$MOTD"
setServerProp "allow-nether" "$ALLOW_NETHER"
setServerProp "announce-player-achievements" "$ANNOUNCE_PLAYER_ACHIEVEMENTS"
setServerProp "enable-command-block" "$ENABLE_COMMAND_BLOCK"
setServerProp "spawn-animals" "$SPAWN_ANIMAILS"
setServerProp "spawn-monsters" "$SPAWN_MONSTERS"
setServerProp "spawn-npcs" "$SPAWN_NPCS"
setServerProp "generate-structures" "$GENERATE_STRUCTURES"
setServerProp "spawn-npcs" "$SPAWN_NPCS"
setServerProp "view-distance" "$VIEW_DISTANCE"
setServerProp "hardcore" "$HARDCORE"
setServerProp "max-build-height" "$MAX_BUILD_HEIGHT"
setServerProp "force-gamemode" "$FORCE_GAMEMODE"
setServerProp "hardmax-tick-timecore" "$MAX_TICK_TIME"
setServerProp "enable-query" "$ENABLE_QUERY"
setServerProp "query.port" "$QUERY_PORT"
setServerProp "enable-rcon" "$ENABLE_RCON"
setServerProp "rcon.password" "$RCON_PASSWORD"
setServerProp "rcon.port" "$RCON_PORT"
setServerProp "max-players" "$MAX_PLAYERS"
setServerProp "max-world-size" "$MAX_WORLD_SIZE"
setServerProp "level-name" "$LEVEL"
setServerProp "level-seed" "$SEED"
setServerProp "pvp" "$PVP"
setServerProp "generator-settings" "$GENERATOR_SETTINGS"
setServerProp "online-mode" "$ONLINE_MODE"
if [ -n "$LEVEL_TYPE" ]; then
# normalize to uppercase
LEVEL_TYPE=${LEVEL_TYPE^^}
echo "Setting level type to $LEVEL_TYPE"
# check for valid values and only then set
case $LEVEL_TYPE in
DEFAULT|FLAT|LARGEBIOMES|AMPLIFIED|CUSTOMIZED)
sed -i "/level-type\s*=/ c level-type=$LEVEL_TYPE" /data/server.properties
;;
*)
echo "Invalid LEVEL_TYPE: $LEVEL_TYPE"
exit 1
;;
esac
fi
if [ -n "$DIFFICULTY" ]; then
case $DIFFICULTY in
peaceful|0)
DIFFICULTY=0
;;
easy|1)
DIFFICULTY=1
;;
normal|2)
DIFFICULTY=2
;;
hard|3)
DIFFICULTY=3
;;
*)
echo "DIFFICULTY must be peaceful, easy, normal, or hard."
exit 1
;;
esac
echo "Setting difficulty to $DIFFICULTY"
sed -i "/difficulty\s*=/ c difficulty=$DIFFICULTY" /data/server.properties
fi
if [ -n "$MODE" ]; then
echo "Setting mode"
case ${MODE,,?} in
0|1|2|3)
;;
su*)
MODE=0
;;
c*)
MODE=1
;;
a*)
MODE=2
;;
sp*)
MODE=3
;;
*)
echo "ERROR: Invalid game mode: $MODE"
exit 1
;;
esac
sed -i "/gamemode\s*=/ c gamemode=$MODE" /data/server.properties
fi
fi
if [ -n "$OPS" -a ! -e ops.txt.converted ]; then
echo "Setting ops"
echo $OPS | awk -v RS=, '{print}' >> ops.txt
fi
if [ -n "$WHITELIST" -a ! -e white-list.txt.converted ]; then
echo "Setting whitelist"
echo $WHITELIST | awk -v RS=, '{print}' >> white-list.txt
fi
if [ -n "$ICON" -a ! -e server-icon.png ]; then
echo "Using server icon from $ICON..."
# Not sure what it is yet...call it "img"
wget -q -O /tmp/icon.img $ICON
specs=$(identify /tmp/icon.img | awk '{print $2,$3}')
if [ "$specs" = "PNG 64x64" ]; then
mv /tmp/icon.img /data/server-icon.png
else
echo "Converting image to 64x64 PNG..."
convert /tmp/icon.img -resize 64x64! /data/server-icon.png
fi
fi
# Make sure files exist to avoid errors
if [ ! -e banned-players.json ]; then
echo '' > banned-players.json
fi
if [ ! -e banned-ips.json ]; then
echo '' > banned-ips.json
fi
# If any modules have been provided, copy them over
[ -d /data/mods ] || mkdir /data/mods
for m in /mods/*.jar
do
if [ -f "$m" ]; then
echo Copying mod `basename "$m"`
cp -f "$m" /data/mods
fi
done
[ -d /data/config ] || mkdir /data/config
for c in /config/*
do
if [ -f "$c" ]; then
echo Copying configuration `basename "$c"`
cp -rf "$c" /data/config
fi
done
if [ "$TYPE" = "SPIGOT" ]; then
if [ -d /plugins ]; then
echo Copying any Bukkit plugins over
cp -r /plugins /data
fi
fi
if [[ $CONSOLE = false ]]; then
EXTRA_ARGS=--noconsole
else
EXTRA_ARGS=""
fi
if [[ ${TYPE} == "FEED-THE-BEAST" ]]; then
echo "Running FTB server modpack start ..."
exec sh ${FTB_SERVER_START}
else
# If we have a bootstrap.txt file... feed that in to the server stdin
if [ -f /data/bootstrap.txt ];
then
exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS < /data/bootstrap.txt
else
exec java $JVM_OPTS -jar $SERVER "$@" $EXTRA_ARGS
fi
fi

22
minecraft-server/start.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
set -e
usermod --uid $UID minecraft
groupmod --gid $GID minecraft
if [ "$SKIP_OWNERSHIP_FIX" != "TRUE" ]; then
fix_ownership() {
dir=$1
if ! sudo -u minecraft test -w $dir; then
echo "Correcting writability of $dir ..."
chown -R minecraft:minecraft $dir
chmod -R u+w $dir
fi
}
fix_ownership /data
fix_ownership /home/minecraft
fi
echo "Switching to user 'minecraft'"
exec sudo -E -u minecraft /start-minecraft "$@"

16
titan-gremlin/Dockerfile Executable file
View File

@@ -0,0 +1,16 @@
FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
ENV TITAN_VERSION 0.5.4
RUN wget -q -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_VERSION-hadoop2.zip
RUN unzip -q /tmp/titan.zip -d /opt && rm /tmp/titan.zip
ENV TITAN_HOME /opt/titan-$TITAN_VERSION-hadoop2
WORKDIR $TITAN_HOME
VOLUME ["/conf","/data"]
ADD start-gremlin.sh /opt/start-gremlin.sh
CMD ["/opt/start-gremlin.sh"]

63
titan-gremlin/README.md Normal file
View File

@@ -0,0 +1,63 @@
Runs the Gremlin console from the Titan Graph Database's "all" distribution.
# Basic Usage
To start the Gremlin console with the default configuration files available:
docker run -it itzg/titan-gremlin
In order to adjust or further define property files to use within Gremlin,
attach a host directory to the container's `/conf` such as
docker run -it -v $(pwd)/conf:/conf itzg/titan-gremlin
After running once your host directory will be populated with the distribution-default
configuration files. Modify those or add to them and they will be available during
the next time you (re)start your container.
# Connecting to Cassandra and Elasticsearch Containers
First start containers for Cassandra and Elasticsearch (pre-2.x),
where the `--name` you choose can be arbitrary or left off to use a generated name.
docker run -d --name gremlin-cass itzg/cassandra
docker run -d --name gremlin-es itzg/elasticsearch:1.x
Now start Gremlin with networking links to those containers with the aliases
* `--link <container>:cass`
* `--link <container>:es`
such as
docker run -it --rm --link gremlin-cass:cass --link gremlin-es:es itzg/titan-gremlin
and with that you can follow the
[Graph of the Gods example](http://s3.thinkaurelius.com/docs/titan/current/getting-started.html), such as
gremlin> GraphOfTheGodsFactory.load(g)
gremlin> saturn = g.V.has('name','saturn').next()
==>v[256]
gremlin> saturn.map()
==>name=saturn
==>age=10000
gremlin> saturn.in('father').in('father').name
==>hercules
# Running and Connecting with Docker Compose
Create the following Compose content as the file `docker-compose.yml` and in
that directory invoke `docker-compose run titan` to run the Gremlin shell
with the supporting Elasticsearch and Cassandra containers.
```
titan:
image: itzg/titan-gremlin
links:
- cass
- es
cass:
image: itzg/cassandra
es:
image: itzg/elasticsearch:1.x
```

64
titan-gremlin/start-gremlin.sh Executable file
View File

@@ -0,0 +1,64 @@
#!/bin/bash
args=
if [ $(ls /conf|wc -l) = 0 ]; then
cp -r $TITAN_HOME/conf/* /conf
fi
rm -f /tmp/titan.properties
if [ -n "$CASS_PORT_9160_TCP_ADDR" ]; then
shortcut=/tmp/titan.properties
cat >> /tmp/titan.properties <<END
storage.backend=cassandra
storage.hostname=$CASS_PORT_9160_TCP_ADDR
END
elif [ -n "$CASS_ADDR" ]; then
shortcut=/tmp/titan.properties
cat >> /tmp/titan.properties <<END
storage.backend=cassandra
storage.hostname=$CASS_ADDR
END
fi
esAddr=${ES_ENV_PUBLISH_AS:-${ES_PORT_9300_TCP_ADDR}}
if [ -n "$ES_CLUSTER" -o -n "$esAddr" ]; then
shortcut=/tmp/titan.properties
cat >> /tmp/titan.properties <<END
index.search.backend=elasticsearch
index.search.elasticsearch.client-only=true
END
if [ -n "$ES_CLUSTER" ]; then
cat >> /tmp/titan.properties <<END
index.search.elasticsearch.ext.cluster.name=$ES_CLUSTER
END
fi
if [ -n "$esAddr" ]; then
# strip off the port spec, if present
esAddr=$(echo $esAddr | cut -d: -f1)
cat >> /tmp/titan.properties <<END
index.search.hostname=$esAddr
END
fi
fi
if [ -n "$shortcut" ]; then
cat > /tmp/init.groovy <<END
g = TitanFactory.open('$shortcut')
println 'The graph \'g\' was opened using $shortcut'
END
args="$args /tmp/init.groovy"
fi
# Allow a little extra time for Cassandra to be ready
sleep 1
exec $TITAN_HOME/bin/gremlin.sh $args

54
titandb/Dockerfile Normal file
View File

@@ -0,0 +1,54 @@
FROM itzg/ubuntu-openjdk-7
MAINTAINER itzg
ENV APT_GET_UPDATE 2014-07-19
RUN apt-get update
RUN apt-get install -y wget unzip
ENV TITAN_VER 0.4.4
ENV TITAN_STORAGE all
ENV REXSTER_VER 2.4.0
RUN wget -O /tmp/titan.zip http://s3.thinkaurelius.com/downloads/titan/titan-$TITAN_STORAGE-$TITAN_VER.zip
RUN wget -O /tmp/rexster.zip http://tinkerpop.com/downloads/rexster/rexster-server-$REXSTER_VER.zip
WORKDIR /opt
RUN unzip /tmp/titan.zip
RUN rm /tmp/titan.zip
RUN unzip /tmp/rexster.zip
RUN rm /tmp/rexster.zip
RUN ln -s titan-$TITAN_STORAGE-$TITAN_VER titan
RUN ln -s rexster-server-$REXSTER_VER rexster-server
RUN mkdir /opt/rexster-server/ext/titan
RUN ln -s /opt/titan-$TITAN_STORAGE-$TITAN_VER/lib/* /opt/rexster-server/ext/titan
RUN wget -O /opt/rexster-server/ext/titan/titan-rexter-$TITAN_VER.jar \
http://central.maven.org/maven2/com/thinkaurelius/titan/titan-rexster/$TITAN_VER/titan-rexster-$TITAN_VER.jar
# Clean up distro area
RUN rm /opt/rexster-server/ext/titan/log4j* /opt/rexster-server/ext/titan/slf4j*
RUN rm /opt/rexster-server/lib/lucene-core*
ADD gremlin /usr/local/bin/gremlin
ADD rexster /usr/local/bin/rexster
WORKDIR titan
ADD titan.properties /opt/titan/conf/titan.properties
ADD init-graph-storage.groovy /tmp/init-graph-storage.groovy
VOLUME ["/data", "/config", "/scripts"]
RUN ln -s /data /opt/titan/db
RUN gremlin -e /tmp/init-graph-storage.groovy && rm /tmp/init-graph-storage.groovy
EXPOSE 8182 8184
ADD rexster.xml /config/rexster.xml
CMD ["/usr/local/bin/rexster", "-s", "-c", "/config/rexster.xml"]

3
titandb/gremlin Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
/opt/titan/bin/gremlin.sh $*

View File

@@ -0,0 +1,12 @@
import com.thinkaurelius.titan.core.TitanFactory
import com.thinkaurelius.titan.core.TitanGraph
import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration
import org.apache.commons.configuration.BaseConfiguration
import org.apache.commons.configuration.Configuration
// Setup a blank one
TitanGraph g = TitanFactory.open('conf/titan.properties')
g.shutdown()

14
titandb/rexster Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/sh
if [ -n "$PUBLISH_ADDR" ]; then
echo "Enabling Doghouse access at http://$PUBLISH_ADDR:8182/doghouse"
sed -i "s#<base-uri>.*</base-uri>#<base-uri>http://$PUBLISH_ADDR</base-uri>#" /config/rexster.xml
fi
if [ -n "$SCRIPT" ]; then
echo "Running Gremlin script $SCRIPT from /scripts..."
gremlin -e /scripts/$SCRIPT
fi
echo "Starting Rexster..."
/opt/rexster-server/bin/rexster.sh $*

28
titandb/rexster.xml Normal file
View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<rexster>
<http>
<base-uri>http://localhost</base-uri>
</http>
<graphs>
<graph>
<graph-name>titan</graph-name>
<graph-type>com.thinkaurelius.titan.tinkerpop.rexster.TitanGraphConfiguration</graph-type>
<graph-location>/data/persistit</graph-location>
<graph-read-only>false</graph-read-only>
<properties>
<storage.backend>persistit</storage.backend>
<storage.directory>/data/persistit</storage.directory>
<storage.buffercount>5000</storage.buffercount>
<storage.index.search.backend>elasticsearch</storage.index.search.backend>
<storage.index.search.local-mode>true</storage.index.search.local-mode>
<storage.index.search.client-only>false</storage.index.search.client-only>
<storage.index.search.directory>/data/es</storage.index.search.directory>
</properties>
<extensions>
<allows>
<allow>tp:gremlin</allow>
</allows>
</extensions>
</graph>
</graphs>
</rexster>

View File

@@ -0,0 +1,7 @@
import com.thinkaurelius.titan.core.TitanFactory
import com.thinkaurelius.titan.example.GraphOfTheGodsFactory
def g = TitanFactory.open('conf/titan.properties')
GraphOfTheGodsFactory.load(g)
g.shutdown()

8
titandb/titan.properties Normal file
View File

@@ -0,0 +1,8 @@
storage.backend=persistit
storage.directory=/data/persistit
storage.buffercount=5000
storage.index.search.backend=elasticsearch
storage.index.search.local-mode=true
storage.index.search.client-only=false
storage.index.search.directory=/data/es

7
ubuntu-openjdk-7/Dockerfile Normal file → Executable file
View File

@@ -2,9 +2,10 @@ FROM ubuntu:trusty
MAINTAINER itzg
ENV BUILT_ON 20140517
ENV APT_GET_UPDATE 2015-10-29
RUN apt-get update
RUN apt-get install -y openjdk-7-jre-headless
RUN DEBIAN_FRONTEND=noninteractive \
apt-get -q -y install openjdk-7-jre-headless wget unzip \
&& apt-get clean
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64