{"id":13816521,"url":"https://github.com/nimmis/docker-spigot","last_synced_at":"2025-04-07T07:10:22.315Z","repository":{"id":24277183,"uuid":"27671709","full_name":"nimmis/docker-spigot","owner":"nimmis","description":"A docker container with spigot, builds spigot.jar on first start","archived":false,"fork":false,"pushed_at":"2024-06-03T11:44:56.000Z","size":79,"stargazers_count":174,"open_issues_count":20,"forks_count":81,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T05:06:40.258Z","etag":null,"topics":["docker-image","minecraft","openjava","spigot","spigot-server","ubuntu"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nimmis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-07T13:53:58.000Z","updated_at":"2024-12-21T01:38:14.000Z","dependencies_parsed_at":"2024-08-04T05:01:39.104Z","dependency_job_id":null,"html_url":"https://github.com/nimmis/docker-spigot","commit_stats":{"total_commits":54,"total_committers":14,"mean_commits":3.857142857142857,"dds":0.4444444444444444,"last_synced_commit":"eaf846448cb57090fe3212da30a78046a7ed479a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-spigot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-spigot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-spigot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-spigot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nimmis","download_url":"https://codeload.github.com/nimmis/docker-spigot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","minecraft","openjava","spigot","spigot-server","ubuntu"],"created_at":"2024-08-04T05:00:44.544Z","updated_at":"2025-04-07T07:10:22.292Z","avatar_url":"https://github.com/nimmis.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"## Minecraft server SPIGOT on Ubuntu 20.04 with Java (Eclipse Adoptium) 8/11/16/17/18/20/21\n\n![](https://img.shields.io/docker/pulls/nimmis/spigot?style=flat-square)\n\n\n**NOW works with Minecraft 1.20**\n\nThis is a major change in logic to build the correct version of spigot so some combination of conditions may not compile correctly. Please make an issue so I can correct it. There will be another build shortly with another feature\n\nJava bug on version 1.17 with 1 core add **-e OTHER_JAVA_OPTS=-Djava.util.concurrent.ForkJoinPool.common.parallelism=1** as workaround\n\nThis docker image builds and runs the spigot version of minecraft. \n\nIf the spigot.jar is not found in the minecraft directory the system pulls down BuildTool and builds a new spigot.jar from the latest\nreleased minecraft.jar\n\nEach time the container is started the presence of the file /minecraft/spigot.jar, if the file is missing a build of spigot.jar is started.\n\nThe spigot daemon is started with supervisord, see my Ubuntu container for a more detailed description of my implementation of an init-process in ubuntu, see [nimmis/ubuntu](https://hub.docker.com/r/nimmis/ubuntu/)\n\nWhat's new is\n\n- Possibility to change spigot versions i running containers\n- Detects version if mc-directory already has a precompiled version active\n- Adjust java version depending of MC version, downloads additional java version if needed\n- Support for Minecraft version 1.20\n- Support for legacy 1.8 (from 1.8.3) with java 8 (use on you own risk)\n\n## Why not a precompiled version of spigot is included\n\nDue to legal reasons you can build it yourself but you can't redistribute the finished jar file.\n\n## Starting the container\n\nTo run the latest stable version of this docker image run\n\n\tdocker run -d -p 25565:25565 -e EULA=true nimmis/spigot\n\nthe parameter\n\n\t-e EULA=true\n\nThe is because Mojang now requires the end user to access their EULA, located at\nhttps://account.mojang.com/documents/minecraft_eula, the be able to start the server.\n\nthe parameter\n\n\t-p 25565:25565\n\nspecifies on which external port the internal 25565 should be connected, in this case the same.\nIf you only type -p 25565 it will connect to a random port on the machine.\n\n## Giving the container a name\n\nTo make it easier to handle you container you can give it a name instead of the long\nnumber that's normally given to it, add a\n\n\t--name spigot\n\nto the run command to give it the name minecraft, then you can start it easier with\n\n\tdocker start spigot\n\tdocker stop spigot\n\n## First time run\n\nThis will take a couple of minutes depending on computer and network speed. It will pull down\nthe selected version on BuildTools and build a spigot.jar from the selected minecraft version.\nThis is done in numerous steps so be patient. \n\nYou can follow the output from the compilation with this command (assuming that you gave the container\nthe name spigot)\n\n\tdocker logs -f spigot\n\t*** open logfile\n\t*** Run files in /etc/my_runonce/\n\t*** Running /etc/my_runonce/00_dump_info.sh...\n\tBuild of nimmis/spigot:latest, date: 2021-12-06T12:54:26Z\n\tBuild of nimmis/ubuntu:20.04, date: 2021-07-04T09:06:36Z\n\t*** Running /etc/my_runonce/50_set_timezone...\n\ttimezone not set, trying to autodetect\n\texternal ip is 95.192.***.***\n\ttimezone should be Europe/Stockholm\n\tsetting timezone to Europe/Stockholm\n\t*** Running /etc/my_runonce/90_autorestart...\n\t*** Run files in /etc/my_runalways/\n\t*** Running /etc/my_runalways/00_minecraft_owner...\n\tmissmatch between directory owner and minecraft user\n\tChanged owner of minecraft to UID 0\n\t*** Running /etc/my_runalways/10_set_mc_version...\n\t*** Running /etc/my_runalways/50_do_build_spigot...\n\tchecking 1.18\n\t  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n\t                                 Dload  Upload   Total   Spent    Left  Speed\n\t100  135k  100  135k    0     0   436k      0 --:--:-- --:--:-- --:--:--  434k\n\tSetting version to 1.18\n\tset java version to 17\n\tBuilding spigot version (1.18) jar file, be patient\n\n\n\nOnce the compilation completes the server will start and you will see something like\n\n\tSuccess! Everything completed successfully. Copying final .jar files now.\n\tCopying spigot-1.18-R0.1-SNAPSHOT-bootstrap.jar to /build-mc/./spigot-1.18.jar\n  \tSaved as ./spigot-1.18.jar\n\tSuccessfull build of spigot version 1.18\n\tSetting 1.18 as current spigot version\n\t*** Running /etc/my_runalways/85_fix_startsh...\n\tstart.sh missing, creating link for /minecraft/start.sh\n\t*** Running /etc/my_runalways/90_eula...\n\t*** Booting supervisor daemon...\n\t*** Supervisor started as PID 781\n\t*** Started processes via Supervisor......\n\tcrond                            RUNNING   pid 783, uptime 0:00:04\n\tspigot                           RUNNING   pid 784, uptime 0:00:04\n\tsyslog-ng                        RUNNING   pid 785, uptime 0:00:03\n\nyou can then exit from the log with CTRL-C\n\n### Selecting version to compile\n\nYou can now change the minecraft version after you started the container the first time.\n\n#### defining version on first start\n\nIf you don't specify this parameter it will check the minecraft directory in the container to see if there is a previous compiled version linked. If so the container will use that version.\n\nIf no version of spigot is linked (like first time) it will always compile the latest version but if you want a specific version you can specify it by adding\n\n\t-e SPIGOT_VER=\u003cversion\u003e\n\nwhere \u003cversion\u003e is the version you would like to use, to build it with version 1.18 add\n\n\t-e SPIGOT_VER=1.18\n\nto the docker run line.\n\n#### change version in a running container\n\nThere is a command to change minecraft version in a running container\n\n\tdocker exec -it spigot set_mc_ver \u003cversion\u003e\n\nwhen the command is executed it will check if there is a compiled version already in the minecraft folder, if not it will build it.\n\nIt first stops the running minecraft, changes java version if needed (download if missing), compiles a new spigot if needed and then starts minecraft again.\n\nIt is not recommended to downgrade version as the world-information is not backwards compatible.\n\n#### versions available\n\nPlease check\nthe web page for [BuildTools](https://www.spigotmc.org/wiki/buildtools/#versions) to get the latest information. \n\n### setup memory to use\n\nThere are two environment variables to set maximum and initial memory for spigot.\n\n#### MC_MAXMEM\n\nSets the maximum memory to use \u003csize\u003em for MB or \u003csize\u003eg for GB, defaulting to 1 GB. To set the maximum memory to 2 GB add this environment variable\n\n    -e MC_MAXMEM=2g\n\n#### MC_MINMEM\n\nSets the initial memory reservation used, use \u003csize\u003em for MB or \u003csize\u003eg for GB, if this parameter is not set, it is set to MC_MAXMEM. To set the initial size to 512 MB\n\n    -e MC_MINMEM=512m\n\n\n#### SPIGOT_AUTORESTART\n\nThis variable controls the behavior of the container when the **stop** command is issued inside minecraft\n\n\t-e SPIGOT_AUTORESTART=yes\n   \nWhich is the default behavior and does not need to be specified, the minecraft server will autostart if the **stop** command is issued.\n\n\t-e SPIGOT_AUTORESTART=no\n\t\nIf the **stop** command is issued the minecraft server will stay down until the container is restarted or the command **mc_start** is issued\n\n#### OTHER_JAVA_OPS\n\nAllows adding other Java options when starting minecraft\n\n\t-e OTHER_JAVA_OPS=\n\n\n\n## look at the last output from the spigot server\n\nTo get an output of the latest events from the spigot server type\n\n\tdocker exec spigot mc_log\n\nand you will see the last 10 lines from the output, this is what you will see after startup\n\n\tAbort with CTRL-C\n\t[13:02:15 INFO]: Zombie Aggressive Towards Villager: true\n\t[13:02:15 INFO]: Experience Merge Radius: 3.0\n\t[13:02:15 INFO]: Preparing start region for level 0 (Seed: 506255305130990210)\n\t[13:02:16 INFO]: Preparing spawn area: 22%\n\t[13:02:17 INFO]: Preparing spawn area: 99%\n\t[13:02:17 INFO]: Preparing start region for level 1 (Seed: 506255305130990210)\n\t[13:02:18 INFO]: Preparing spawn area: 95%\n\t[13:02:18 INFO]: Preparing start region for level 2 (Seed: 506255305130990210)\n\t[13:02:18 INFO]: Server permissions file permissions.yml is empty, ignoring it\n\t[13:02:18 INFO]: Done (3.650s)! For help, type \"help\" or \"?\"\n\nIt will continue to output everything from the console until you press CTRL-C \n\n## sending commands to the server console\n\nYou don't need to have an interactive container to be able to send commands to the console. To send\na command to set the time to day you type\n\n\tdocker exec spigot mc_send \"time set day\"\n\nIf this was the first command issued after a start the output should look like\n\n\t[13:02:15 INFO]: Zombie Aggressive Towards Villager: true\n\t[13:02:15 INFO]: Experience Merge Radius: 3.0\n\t[13:02:15 INFO]: Preparing start region for level 0 (Seed: 506255305130990210)\n\t[13:02:16 INFO]: Preparing spawn area: 22%\n\t[13:02:17 INFO]: Preparing spawn area: 99%\n\t[13:02:17 INFO]: Preparing start region for level 1 (Seed: 506255305130990210)\n\t[13:02:18 INFO]: Preparing spawn area: 95%\n\t[13:02:18 INFO]: Preparing start region for level 2 (Seed: 506255305130990210)\n\t[13:02:18 INFO]: Server permissions file permissions.yml is empty, ignoring it\n\t[13:02:18 INFO]: Done (3.650s)! For help, type \"help\" or \"?\"\n\t[13:12:35 INFO]: Set the time to 1000\n\nIt will continue to output everything from the console until you press CTRL-C\n\n### using the minecraft op command \n\nTo make yourself operator in the game use **mc_send** command, for example give the user **myuser** op use the command.\n\n\tdocker exec spigot mc_send op myuser\n\n### using the minecraft stop command\n\nBy default the minecraft server will automatically restart on a **stop** inside the minecraft application. You can override this behavior by using\n\n\t-e SPIGOT_AUTORESTART=no\n\nThis will prevent the server automatically restarting and minecraft has to be started again with the **mc_start** command\n\n\n## starting and stopping the server\n\nTo stop the server but not the container do\n\n\tdocker exec spigot mc_stop\n\nTo start it after being stopped do\n\n\tdocker exec spigot mc_start\n\nFinally to restart it do\n\n\tdocker exec spigot mc_restart\n\n## stopping the container\n\nWhen the container is stopped with the command\n\n\tdocker stop spigot\n\nthe spigot server is shutdown nicely with a console stop command to give it time to save everything before\nstopping the container. If you look in the output from the server you will see something like\n\n\t[13:01:51 INFO]: Stopping the server\n\t[13:01:51 INFO]: Stopping server\n\t[13:01:51 INFO]: Saving players\n\t[13:01:51 INFO]: nimmis lost connection: Server closed\n\t[13:01:51 INFO]: nimmis left the game.\n\t[13:01:51 INFO]: Saving worlds\n\t[13:01:51 INFO]: Saving chunks for level 'world'/Overworld\n\t[13:01:51 INFO]: Saving chunks for level 'world_nether'/Nether\n\t[13:01:51 INFO]: Saving chunks for level 'world_the_end'/The End\n\n## Having the minecraft files on the host machine\n\nIf you delete the container all your files in minecraft will be gone. To save them where it's\neasier to edit and do a backup of the files you can attach a directory from the host machine\n(where you run the docker command) and attach it to the local file system in the container.\nThe syntax for it is\n\n\t-v /host/path/to/dir:/container/path/to/dir\n\nTo attach the minecraft directory in the container to directory /home/nimmis/mc-srv you add\n\n\t-v /home/nimmis/mc-srv:/minecraft\n\n### problems with external mounted volumes\n\nWhen a external volume is mounted the UID of the owner of the volume may not match the UID of the minecraft user (1000). This can result in problems with write/read access to the files. \n\nTo address this problem a check is done between UID of the owner of /minecraft and the UID of the user minecraft. If there is a mismatch the UID of the minecraft user is changed to match the UID of the directory.\n\nIf you don't want to do this and want to manually set the UID of the minecraft user there is a variable named SPIGOT_UID which defines the minecraft user UID, adding\n\n\t-e SPIGOT_UID=1132\n\nsets the minecraft user UID to 1132.\n\n## Other commands available to container\n\nThe syntax is\n\n\tdocker exec -ti \u003cspigot container name\u003e \u003ccommand\u003e \u003cparamaters\u003e\n\n### command: get_mc_versions\n\nIf you get minecraft version not found and it is a version released after to started the container the first time. You need to update the list of available versions, do \n\n\tdocker exec -it \u003cspigotverson\u003e get_mc_versions\n\nand you should get an output simular to\n\n\tdocker exec -it spigot get_mc_versions\n\t  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n\t100  135k  100  135k    0     0   498k      0 --:--:-- --:--:-- --:--:--  498k\n\nand the versionlist is updated.\n\n## Old versions news\n\n- Updated java version to 17 which is a LTS version\n- Adopt moved to Eclipe Foundation and changed name to Adoptium\n- Updated java version to 16 to compile minecraft 1.17\n- Switched to Adopt OpenJDK\n- Fix for problem introduced during fall of 2017 for both Windows 10 and MacOS versions of docker, failed to build new versions of spigot \n- Autodetection of timezone if container has access to internet\n- adjust minecraft user UID to match mounted volume\n- selectable memory size for the Java process\n- selectable spigot version\n- do a nice shutdown of the server when the docker stop command is issued\n- docker accessible commands to \n   - start/stop/restart the spigot server\n   - send console commands to the server\n   - look at console output from the server\n\n## Issues\n\nIf you have any problems with or questions about this image, please contact us by submitting a ticket through a [GitHub issue](https://github.com/nimmis/docker-spigot/issues \"GitHub issue\")\n\n1. Look to see if someone already filled the bug, if not add a new one.\n2. Add a good title and description with the following information.\n - if possible an copy of the output from **cat /etc/BUILDS/*** from inside the container\n - any logs relevant for the problem\n - how the container was started (flags, environment variables, mounted volumes etc)\n - any other information that can be helpful\n\n## Contributing\n\nYou are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.\n\n## Future features\n\n- automatic backup\n- plugins\n- more....\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimmis%2Fdocker-spigot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimmis%2Fdocker-spigot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimmis%2Fdocker-spigot/lists"}