#How to Access Container in Docker LXC
20 messages · Page 1 of 1 (latest)
Wdym with unreachable? Docker himself doesnt have a ui
I'm using Portainer, apologies. I can access Portainer on port :8006, but when adding a container using the port :8437 it's unreachable by the host.
Portainer is fully configured and all time reachable?
yes
If you curl from the host? (Not in the LXC)
curl -v http://10.0.0.200:8437/
Firewall active? Or ufw?
* Trying 10.0.0.200:8437...
* connect to 10.0.0.200 port 8437 from 10.0.0.19 port 57444 failed: Connection refused
* Failed to connect to 10.0.0.200 port 8437 after 0 ms: Could not connect to server
* closing connection #0
curl: (7) Failed to connect to 10.0.0.200 port 8437 after 0 ms: Could not connect to server```
No firewall active currently, not sure about ufw
would there be conflicts since portainer is running on port :8006/9443?
so kinda sharing the same IP
That say there is nothing? Are you sure that the container run healthy?
Can you check inside the lxc?
ss -ltnp | grep 8437 || echo "NOT LISTENING"
root@docker:~# ss -ltnp | grep 8437 || echo "NOT LISTENING"
LISTEN 0 4096 0.0.0.0:8437 0.0.0.0:* users:(("docker-proxy",pid=748,fd=7))
LISTEN 0 4096 [::]:8437 [::]:* users:(("docker-proxy",pid=755,fd=7)) ```
not sure if this helps at all
docker exec -it mousehole ss -ltnp
docker exec -it mousehole curl -v http://127.0.0.1:8437/
docker exec -it mousehole curl -vk https://127.0.0.1:8437/
OCI runtime exec failed: exec failed: unable to start container process: exec: "ss": executable file not found in $PATH
root@docker:~# docker exec -it mousehole curl -v http://127.0.0.1:8437/
* Trying 127.0.0.1:8437...
* connect to 127.0.0.1 port 8437 failed: Connection refused
* Failed to connect to 127.0.0.1 port 8437 after 0 ms: Couldn't connect to server
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 8437 after 0 ms: Couldn't connect to server
root@docker:~# docker exec -it mousehole curl -vk https://127.0.0.1:8437/
* Trying 127.0.0.1:8437...
* connect to 127.0.0.1 port 8437 failed: Connection refused
* Failed to connect to 127.0.0.1 port 8437 after 0 ms: Couldn't connect to server
* Closing connection 0
curl: (7) Failed to connect to 127.0.0.1 port 8437 after 0 ms: Couldn't connect to server```
Ah it look you have bind the wrong Port,
docker inspect mousehole | grep -i -E 'expose|port'
"PortBindings": {
"HostPort": "8437"
"PublishAllPorts": false,
"ExposedPorts": {
"Ports": {
"HostPort": "8437"
"HostPort": "8437"```
Your port bind is missing? Can you share the compose? (Redacted)
i think im gonna have to actually look further into this to see if this would even work with my setup. but this is what im using: https://github.com/t-mart/mousehole?tab=readme-ov-file#docker-compose-recommended