#How to Access Container in Docker LXC

20 messages · Page 1 of 1 (latest)

proud flax
#

I'm new to all of this so it might be something simple ive missed.

shrewd beacon
#

Wdym with unreachable? Docker himself doesnt have a ui

proud flax
#

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.

shrewd beacon
#

Portainer is fully configured and all time reachable?

proud flax
#

yes

shrewd beacon
#

Firewall active? Or ufw?

proud flax
#
*   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

shrewd beacon
#

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"

proud flax
#
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

shrewd beacon
proud flax
#
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```
shrewd beacon
#

Ah it look you have bind the wrong Port,

docker inspect mousehole | grep -i -E 'expose|port'

proud flax
#
            "PortBindings": {
                        "HostPort": "8437"
            "PublishAllPorts": false,
            "ExposedPorts": {
            "Ports": {
                        "HostPort": "8437"
                        "HostPort": "8437"```
shrewd beacon
#

Your port bind is missing? Can you share the compose? (Redacted)

proud flax