Closed Zottelchen closed 3 years ago
This all looks fine. What is the command used when running the Docker image? Is port 8080 exposed (e.g., -p 8080:8080
)?
The command was docker run -p 8080:8080 lfs
(after building docker build . -t lfs
). When trying to open it in the browser, it also resets the connection.
I was able to reproduce the problem pretty easily. The problem is binding to localhost
, which seems to be an old Docker pitfall. The solution is to either use --host=0.0.0.0:8080
or simply don't specify --host
since it defaults to 0.0.0.0:8080
anyway.
If I understand correctly how Docker works, localhost
resolves to 127.0.0.1
which is a loopback network interface private to the container's network namespace and doesn't have access to the outside world. Rudolfs (or any server, really) needs to bind to a network interface that is a bridge to the host network namespace.
Using 0.0.0.0
means the server shall try to bind to all available network interfaces, including both the bridge interface and loopback interface.
I've tried building a simple image using:
It starts fine:
I've added the following to my .lfsconfig:
However
git push
fails:What did I miss?