Static GitHub Issues

[3318] cannot run wget http://localhost:3000 inside a docker container

prev: How nuxt loads some static JS libraries?
next: cannot run wget http://localhost:3000 inside a docker container

Version

v1.4.0

Reproduction link

https://github.com/markxtji/mynuxt

Steps to reproduce

git clone https://github.com/markxtji/mynuxt.git cd mynuxt docker-compose up

then login to the container

docker exec -it <container id> sh

then run wget http://127.0.0.1:300

sometimes you will get error getting response, sometimes it is normal, the symptom is intermittent :100: node:/app$ wget http://127.0.0.1:3000 Connecting to 127.0.0.1:3000 (127.0.0.1:3000) wget: error getting response node:/app$ wget http://127.0.0.1:3000 Connecting to 127.0.0.1:3000 (127.0.0.1:3000) wget: error getting response node:/app$ wget http:/localhost:3000 wget: bad port spec 'http:' node:/app$ wget http://localhost:3000 Connecting to localhost:3000 (127.0.0.1:3000) index.html 100% |****| 1311 0:00:00 ETA node:/app$ wget http://127.0.0.1:3000

Sometimes you will even get error like this

node:/app$ wget http://localhost:3000 Connecting to localhost:3000 (127.0.0.1:3000) wget: error getting response: Address not available node:/app$ wget http://localhost:3000 Connecting to localhost:3000 (127.0.0.1:3000) wget: error getting response: Address not available node:/app$ wget http://localhost:3000 Connecting to localhost:3000 (127.0.0.1:3000) index.html 100% |****| 1311 0:00:00 ETA node:/app$ wget http://localhost:3000 Connecting to localhost:3000 (127.0.0.1:3000) wget: error getting response: Address not available

What is expected ?

resolve the issue

What is actually happening?

cannot run wget http://localhost:3000 inside a docker container

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This bug report is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c7048">#c7048</a>)</em></sub></div>