I have pulled the Security Shepherd Docker image and followed all the instructions for the Docker setup. I believe all steps were successful.

Now I don't know how to run the Shepherd application, while the Docker image is running. I assumed it would be something similar to the VM - connect from a browser to the IP address of the image, but I get a timeout...

How could I start the Shepherd?

  • It looks according to the documentation that it should bind to port 80 and 443. Did you try https? – user159148 Sep 15 '17 at 22:11
  • Yes... After a warning that the site is not secure (?) I get redirected to the Apache Tomcat homepage from https://localhost:443 and to a "Site can't provide a secure connection" error from https://localhost:80 ... :( – Ioanna Oct 12 '17 at 13:37

It depends of how did you run the container. If you specified -p option, then you mapped ports from your host to the container in order to access it directly on your localhost. I mean, for example, if you put on docker run command -p 5555:80, you are mapping container port 80 to host's port 5555, so you can access to it on http://localhost:5555.

If you don't want to map ports in order to prevent anyone on your network can access to the container through your host, run it without -pand then you can do a docker inspect command to find the container ip address. Because the containers by default are accessible only by the host machine on a specific ip. Docker set iptables on run and allow only to you to access to the container. You can do docker inspect yourContainerName | grep '"IPAddress"' | head -n 1 and you'll get the ip address of your container. Then you can access only from the host to http://<yourResultIpFromBeforeCmd>

Hope it helps.

  • Yes, I did specify the -p option, with 80:80 and 443:443 but neither localost:443 nor localhost:80 work. Also, $ docker inspect ismisepaul/securityshepherd | grep '"IPAddress"' doesn't print anything. Looked through the result of $ docker inspect ismisepaul/securityshepherd (no grep) and indeed there's no IPAddress there... :( – Ioanna Oct 12 '17 at 13:35
  • So the problem is of your image or container. This is not a docker itself problem. Your docker container is not well configured. Maybe the image is not ok or you are not configuring it well. – OscarAkaElvis Oct 12 '17 at 18:10
  • It finally worked. After switching from windows 8 to windows 10 and modifying the command to start the container to docker run -i -p 82:80 -p 444:443 ismisepaul/securityshepherd /bin/bash (because ports 80 and 443 were automatically assigned to Tomcat), I could connect to the service running in docker on https://localhost:444. Thank you for your help, the ports hint and docker inspect were useful. – Ioanna Oct 13 '17 at 13:34

When running Docker on some flavors of Windows it runs in a Virtualbox instance so you'd need to look up Docker's ip, then connect to http://docker.ip.ad.dr:port, not localhost.

There may be a more Docker-ey way to do it, but I always just look it up using ipconfig. On my pc it shows up as "Ethernet adapter VirtualBox Host-Only Network", typically in the 192.168.99.x range.

See stackoverflow and docker.

Not the answer you're looking for? Browse other questions tagged or ask your own question.