简体   繁体   中英

Userland proxy error when launching docker image on Google Cloud Platfrom

I am trying to run a standard nginx container on one of my GCP VMs. When i run

docker run -it --rm -p 80:80 tiangolo/uwsgi-nginx-flask:python3.6

I get the following error:

Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use

However it is a clean VM instance I created. During VM creation I also checked the http port to make sure port 80 is open (i need to add https - but this is my first deployment test).

The image does work locally. It seems to be a Google Cloud Platform configuring thing I guess.

I tried to reproduce the issue on my end, but I did not find any error. Here are the below steps I have taken.

  1. First I spin up a Debian vm instance in the Google cloud platform and allowed incoming http in the firewall for that VM instance so that I could access the site from outside.
  2. Then I installed docker in the VM instance. I followed this link .
  3. After that, I made sure that http port is free in the VM instance. I used the below command. netstat -an | egrep 'Proto|LISTEN' You may check the link here .
  4. At this point, I issued the docker command you provided. docker run -it --rm -p 80:80 tiangolo/uwsgi-nginx-flask:python3.6

I did not get any error and I could access the nginx page.

“Hello World from Flask in a uWSGI Nginx Docker container with Python 3.6 (default)”

If you spin a new VM with the same docker version, do you have the same issue? What kind of image is your VM running?

it was my own stupid error.. sorry for asking the SO community... so what did I do wrong.. I connected through the web client.. which means port 80 is already in use. causing all this havoc :(

so just ssh in and try again and it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM