Ich habe 2 Docker Bild (Nginx, Yeoman) und zugeordneten Port wie folgt.Zugriff Grunt dienen im Inneren Docker
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3a71ee900cc0 webserver:0.1 "nginx" About an hour ago Up About an hour 443/tcp, 0.0.0.0:8080->80/tcp webserver
af57b93ca326 silarsis/yeoman "/bin/bash" About an hour ago Up About an hour 0.0.0.0:9000->9000/tcp yeoman
Und in yeoman Docker zu machen grunzen Server.
yeoman_docker$ yo ..scafolding stuff
yeoman_docker$ ls
Gruntfile.js README.md app bower.json bower_components node_modules package.json test
yeoman_docker$ grunt serve
Running "serve" task
Done, without errors.
Execution Time (2016-09-23 07:20:28 UTC-0)
loading tasks 5ms ▇▇▇▇▇▇▇ 19%
loading grunt-contrib-copy 13ms ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 50%
copy:styles 8ms ▇▇▇▇▇▇▇▇▇▇▇ 31%
Total 26ms
Running "autoprefixer:server" (autoprefixer) task Autoprefixer's process() method is deprecated and will removed in next major release. Use postcss([autoprefixer]).process() instead File .tmp/styles/main.css created.
Running "connect:livereload" (connect) task Started connect web server on http://localhost:9000
Running "watch" task Waiting...
Behalten Sie dieses SSH, um grunzen dienen zu erhalten. Nginx ist von lokal zugänglich (127.0.0.1:8080) Aber grunt kann nicht zugreifen (127.0.0.1:9000). Gibt es einen Unterschied zwischen dem Grunt Server im lokalen und dem Docker? Was soll ich damit machen?
Es scheint, dass grunt Server nicht lokal ist.
$ telnet 127.0.0.1 9000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Connection closed by foreign host.
$ netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 10.0.8.1:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::9000 :::* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
tcp6 0 0 :::21 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 127.0.0.1:9000 127.0.0.1:39682 TIME_WAIT
Sie haben mich! Danke :) –
Kein Problem. Bin selbst dort gewesen. ;) Fröhliches Hacken! – Snorre