Testing nginx in a Docker container in on Ubuntu Core?

  1. Followed Setting up Ubuntu Core on a KVM
    • It shows you how to start the vm and forward ports back to your host machine.
  2. Followed Snappy Tour
    • It shows you how to install Docker on Ubuntu Core
  3. Installed the latest nginx image
  4. Looked at Managing Containers and interactively got nginx running in my container

Now the container is running nginx on a random port.

Back in Ubuntu Core, I tried to install wget or curl to return a page from nginx in my container but there isn’t one either one listed in snappy search; how else can I test this?

Answer

nc (netcat) will do the trick.

nc 127.0.0.1 32771
GET / HTTP/1.1
Host: 127.0.0.1
User-Agent: netcat

32771 is the random port in my case,
a detailed explanation is available here:
download a URL by netcat

enter image description here

Attribution
Source : Link , Question Author : leeand00 , Answer Author : Community

Leave a Comment