docker-minecraft-server
docker-minecraft-server copied to clipboard
The ONLINE_MODE env var is not toggling online-mode
Describe the problem
Running docker with the environment variable ONLINE_MODE=TRUE seems to be ignored. The example is taken directly from the docs.
docker run -d -p 25565:25565 \
--name mc6g \
-e ONLINE_MODE=TRUE \
-e VERSION=1.19.2 \
-e EULA=TRUE \
-e MEMORY=6G -v /opt/minecraft-data:/data itzg/minecraft-server
Here is the log entry which suggests the environment variable is not getting evaluated correctly.
22:28:03] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[22:28:03] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
[22:28:03] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[22:28:03] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
Container definition
docker run -d -p 25565:25565 \
--name mc6g \
-e ONLINE_MODE=TRUE \
-e VERSION=1.19.2 \
-e EULA=TRUE \
-e MEMORY=6G -v /opt/minecraft-data:/data itzg/minecraft-server
Container logs
22:28:03] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
[22:28:03] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
[22:28:03] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
[22:28:03] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
Try adding OVERRIDE_SERVER_PROPERTIES=true since it otherwise doesn't touch server.properties after initial creation.
Thank you @itzg !
As an environment variable or a server properties setting?
I may be confused but these are passed in to the environment at the first time an image becomes a running container. Or, does initial creation refer to something else?
As an environment variable
https://github.com/itzg/docker-minecraft-server#server-configuration