1

I'm running Docker on a Raspberry Pi 3 using Raspbian (Jessie). I want to access my containers from other PCs on the same network. Can someone explain how can I make containers to show under my router list as an independent machine?

Port forwarding is useless because we are using few ports and if we need to add some new function to it, we must commit the container, delete the container, create a new container under the image created and add the new ports to forward.

ggorlen
  • 44,755
  • 7
  • 76
  • 106
Diogo Jesus
  • 318
  • 4
  • 19
  • Containers are not VMs. Read [this blog post](https://blog.docker.com/2016/03/containers-are-not-vms/). – creimers Mar 30 '17 at 08:42

1 Answers1

0

Maybe you can try docker ps -a to check the container's states and available ports.

This is the result on my Linux (IP address is 135.251.247.21):

sdn@sdn-KVM:~$ docker ps -a 

CONTAINER ID   IMAGE                             COMMAND                  CREATED             STATUS      PORTS                                                                       NAMES
be8c8289fe20   135.249.45.113:9005/onos:1.7.004  "./bin/onos-service"     3 weeks ago         Up 7 hours  0.0.0.0:6633->6633/tcp, 6653/tcp, 0.0.0.0:8101->8101/tcp, 9876/tcp, 0.0.0.0:9191->8181/tcp   onos-docker

I can access this container from a remote machine via SSH: ssh -p 8101 karaf@135.251.247.21.

If you cannot access your container from a remote machine, you can try to access it on your local machine by running docker exec -it xxx bash, where xxx is the container name.

ggorlen
  • 44,755
  • 7
  • 76
  • 106
W.Ranger
  • 46
  • 4
  • yes for that i could also use the command sudo docker run -d -p : image tail -f /dev/null but i would like to have independent local IPs to access the container i took a look over this link bur it didn't work with me (no errors showed up, it simply didn't changed anything. https://marcelwiget.wordpress.com/2016/03/20/bridge-docker-container-with-host-interface/ – Diogo Jesus Mar 30 '17 at 08:58