itzg / docker-minecraft-server

Docker image that provides a Minecraft Server that will automatically download selected version at startup
https://docker-minecraft-server.readthedocs.io/
Apache License 2.0
9.23k stars 1.52k forks source link

Java_Home not set on Java8 image #2088

Closed Nicolas-mahe closed 1 year ago

Nicolas-mahe commented 1 year ago

Describe the problem

When I run my docker-compose, in the container the log it's tell me to set Java_Home vars

Container definition

version: '3.9'

https://github.com/itzg/docker-minecraft-server

https://github.com/itzg/docker-mc-backup

https://www.curseforge.com/minecraft/modpacks/ragnamod-vi

C:\Users\Nico2\curseforge\minecraft\Instances\Ragnamod VI\ #path of Modpacks

services: minecraft: image: itzg/minecraft-server:java8 environment: EULA: TRUE VERSION: 1.16.5 TYPE: CURSEFORGE CF_SERVER_MOD: /modpacks/RagnamodVI-Serverfiles-6.1.10.zip MOTD: "RaBByT Ragnamod IV" MEMORY: "" JVM_XX_OPTS: "-XX:MaxRAMPercentage=100" MAX_PLAYERS: 3 SPAWN_PROTECTION: 0 VIEW_DISTANCE: 10 SIMULATION_DISTANCE: 5 ENABLE_WHITELIST: TRUE DIFFICULTY: Hard OPS: "RaBByt_Tv" ALLOW_NETHER: TRUE ANNOUNCE_PLAYER_ACHIEVEMENTS: TRUE GENERATE_STRUCTURES: TRUE SNOOPER_ENABLED: FALSE MAX_TICK_TIME: 60000 TZ: Europe/Paris MODE: 0 # 0=survival, 1=creative, 2=adventure, 3=spectator // not sure it work FORCE_GAMEMODE: TRUE # force default gamemode at connection HARDCORE: FALSE ALLOW_FLIGHT: TRUE MAX_WORLD_SIZE: 10000 SPAWN_ANIMALS: TRUE SPAWN_MONSTERS: TRUE SPAWN_NPCS: TRUE PVP: TRUE LEVEL_TYPE: normal # type of generating world SERVER_NAME: Ragnamod6_RaBByT ENABLE_RCON: TRUE deploy: resources: limits: memory: 28160M volumes:

volumes: data: {} modpacks: {} networks: web: external: true

Container logs

[init] Running as uid=1000 gid=1000 with /data as 'drwxrwx---+ 2 1000 1000 4096 Apr 19 19:01 /data' /start-configuration: line 92: /dev/null: Permission denied [init] ERROR: your Docker provider has an annoying flaw where it [init] tries to set PATH even though the container establishes [init] a very specific value. [init] Resolved version given 1.16.5 into 1.16.5 and major version 1.16

ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-1.8-openjdk/jre

Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

[init] Resolving type given CURSEFORGE

ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-1.8-openjdk/jre

Please set the JAVA_HOME variable in your environment to match the location of your Java installation.

Nicolas-mahe commented 1 year ago

The issue is on my side, I run the container with -e uid et gid to 0 (root) and it's work