Comments (6)
The solution is to not have underscores (_
) in the hostname as Java (or whatever) does not seem to support that.
from docker-bungeecord.
Ah yes, I forget that underscores generally aren’t allowed in hostnames...it’s not just a Java thing:
https://en.m.wikipedia.org/wiki/Hostname#Syntax
It would be nice if Docker compose warned about that in the first place.
from docker-bungeecord.
Hey,
Firstly, if you need to see what is the hostname. You can cat /etc/hosts
in the container. But, with docker-compose, the host of your others containers is the name of the service. In your case is lobby
Secondly, you don't need to link your lobby with your bungee because docker-compose create a network for you.
And why did you use 20000
as port ? The target port of itzg/docker-minecraft-server is 25565 (https://github.com/itzg/docker-minecraft-server/blob/master/Dockerfile#L27)
If you have changed your port of your Minecraft-server, set it back to 25565 !
With these modifications, your docker-compose.yml
look like this:
version: '3.7'
services:
lobby:
image: itzg/minecraft-server
environment:
EULA: "TRUE"
TYPE: "PAPER"
MAX_MEMORY: "4G"
VERSION: "1.15.2"
USE_AIKAR_FLAGS: "TRUE"
volumes:
- /mc/pc/lobby:/data
command: --noconsole
restart: always
bungee:
image: itzg/bungeecord
ports:
- 25565:25577
volumes:
- /mc/pc/bungee/server:/server
restart: always
And your bungee.yml
:
servers:
lobby:
motd: ...
address: lobby:25565
restricted: false
from docker-bungeecord.
To add some background to @iverly 's great feedback, this is the docs that describes the networking feature in docker-compose, which are very cool:
https://docs.docker.com/compose/networking/
from docker-bungeecord.
I would like to add to this:
My Bungeecord config:
# ...
servers:
lobby:
motd: test - lobby
address: minecraft_lobby:25565
restricted: false
The docker-compose.yml
for Bungeecord:
version: '3'
services:
bungeecord:
image: itzg/bungeecord
container_name: bungeecord
restart: always
ports:
- '25565:25577'
volumes:
- ./server:/server
The docker-compose.yml
of a Spigot server (minecraft_lobby
):
version: '3'
services:
minecraft_lobby:
image: itzg/minecraft-server
container_name: minecraft_lobby
restart: always
environment:
TYPE: SPIGOT
EULA: 'TRUE'
MEMORY: 2G
USE_AIKAR_FLAGS: 'true'
VERSION: '1.15.2'
ONLINE_MODE: 'FALSE'
networks:
- bungeecord_default
- default
volumes:
- ./data:/data
networks:
bungeecord_default:
external: true
And I get the same error as @ColinTree:
09:33:08 [SEVERE] Exception in thread "main"
09:33:08 [SEVERE] java.lang.IllegalArgumentException: Invalid host/address: minecraft_lobby:25565
09:33:08 [SEVERE] at net.md_5.bungee.Util.getAddr(Util.java:54)
09:33:08 [SEVERE] at net.md_5.bungee.conf.YamlConfig.getServers(YamlConfig.java:221)
09:33:08 [SEVERE] at net.md_5.bungee.conf.Configuration.load(Configuration.java:106)
09:33:08 [SEVERE] at net.md_5.bungee.BungeeCord.start(BungeeCord.java:273)
09:33:08 [SEVERE] at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
09:33:08 [SEVERE] at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
I can resolve the hostname within a shell (i.e. bash
) inside the Bungeecord container:
bash-4.4# nslookup minecraft_lobby
nslookup: can't resolve '(null)': Name does not resolve
Name: minecraft_lobby
Address 1: 172.18.0.3 minecraft_lobby.bungeecord_default
I tried using minecraft_lobby.bungeecord_default
as well, but it wouldn't work.
It works when I use the IP address of the minecraft_lobby
server instead of the hostname, like so:
# ...
servers:
lobby:
motd: test - lobby
address: 172.18.0.3:25565
restricted: false
But that's not a good solution at all, since the IP address could change (container restarts, different setup etc.).
It seems that Bungeecord/Java doesn't resolve internal hostnames properly. Any way to fix this/work around it?
from docker-bungeecord.
This issue is stale because it has been open 30 days with no activity. Please add a comment describing the reason to keep this issue open.
from docker-bungeecord.
Related Issues (20)
- bungeecord Type Velocity, can't connect to RCON CLI. Throws i/o timeout HOT 2
- Support GID, UID HOT 2
- Health status HOT 5
- SPIGET_PLUGINS not following redirects to Bukkit download page. HOT 6
- No response from RCON-CLI HOT 4
- Modrinth Plugin Support HOT 1
- RCON environment variables don't get into the config file HOT 1
- Support mounting kubernetes secrets HOT 8
- query port not exposed (udp) HOT 3
- Unable to mount velocity.toml into the container HOT 10
- [Server thread/ERROR]: Failed to validate profile key: Invalid signature for profile public key. HOT 2
- Healthcheck: "server not ready" HOT 2
- Copying plugin configs HOT 2
- Add support for config patching
- Request: Script similar to mc-send-to-console HOT 4
- Support more Java version HOT 3
- When specifying modrinth plugins on velocity the logs output that plugins are downlaoding but no plugins get loaded HOT 1
- Support 1.20.3 change to ping description structure
- Apply patches after related config file is created HOT 1
- Question : Using auto pause in docker-minecraft-server with docker-bungeecord and Velocity HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-bungeecord.