Is there some reason we can’t specify a hostname instead of an IP for the PeerAddress
entries in the config file? If the reason is just that it hasn’t been done, is there any reason I shouldn’t log a feature request?
I’m struggling with this same issue of the IP changing each time described in this thread, but docker doesn’t allow static IPs when running in swarm mode.
I modified the above solution from @kvaps at the end of that thread to try to do the same thing, since it seems like a sensible workaround; unfortunately, I can’t see how to get the container IP in the docker compose file. I tried this:
command: [ '/bin/sh', '-c', 'IP=$$(hostname -i); sed -i "/PeerAddress/ s/: .*/: \"$IP\",/g" /root/.config/pydio/cells/pydio.json; exec /bin/docker-entrypoint.sh cells start']
…but hostname -i
always resolves to 127.0.0.1
, which doesn’t work.