accedere a localhost dall'interno di Docker

gio661

Utente Attivo
8 Ott 2011
30
0
6
Codice:
+ curl localhost
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
bla bla bla...

Tutto ok, ma adesso proviamo dall'interno di un contenitore docker

Codice:
+ cat Dockerfile
FROM php:7.2.2-cli

+ cat test.sh
#!/bin/bash -e
cd $(dirname "$0")

docker build --network host -t test-image .
docker run test-image curl localhost

+ ./test.sh
Sending build context to Docker daemon 4.096 kB
Step 1/1 : FROM php:7.2.2-cli
 ---> 21c3582549e6
Successfully built 21c3582549e6
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (7) Failed to connect to localhost port 80: Connection refused

Perchè non funziona?
 
Discussioni simili
Autore Titolo Forum Risposte Data
P Accedere a IIS da remoto senza un IP statico Web Server 1
Shyson Non mi fa accedere al sito WordPress 12
S Database Netsons: come accedere da remoto PHP 1
I Non riesco ad accedere ftp tramite IP in LAN Reti LAN e Wireless 6
F [PHP] Aggiungere ruolo per accedere alle pagine PHP 2
W accedere a DB Postgres su altro server PHP 2
AkenStyle Come accedere a una tabella? Database 1
F Quali credenziali per accedere al sitemarket? Supporto Mr.Webmaster 5
L [Javascript] Cliccare su mi piace per accedere a vedere la pagina Javascript 0
A accedere a Json Array multidimensionale jQuery 1
S Poter accedere ad un sito solo se si proviene da un altro preciso WordPress 2
O accedere direttamente a una SUPERGLOBAL PHP 1
felino [Backend] Impossibile accedere al backend WordPress 2
A Impossibile accedere alle configurazioni del router Reti LAN e Wireless 1
M Impossibile accedere a pc su LAN Reti LAN e Wireless 1
Marco_88 Impossibile accedere al database PHP 16
felino Server su macchina linux: come accedere a phpMyAdmin? Apache 1
M Accedere da remoto ad una macchina virtuale Server Dedicati e VPS 2
L accedere alla apgina dopo clic su pagina facebook Javascript 1
Marcolotto Android accedere all'ID UNIVOCO del device Sviluppo app per Android 2
L [VB] Accedere a database access con visual studio (linguaggio vb) .NET Framework 1
Eliox Accedere a tutte le proprietà di un oggetto PHP 1
N Accedere ai dati di un gruppo con le API di Facebook PHP 0
best impossibile accedere Supporto Mr.Webmaster 4
M Wordpress: password per accedere ad un sito privato WordPress 1
M Accedere PC Privato dall'esterno Reti LAN e Wireless 2
alessandro1997 [TUTORIAL] Accedere ad un server FTP come una normale cartella Linux e Software 1
R codice php per accedere a files protetti .htaccess PHP 2
K AIUTO accedere da remoto server apache in lan Apache 0
Cforever accedere a campi Crystal Reports in .NET ASP.NET 1
N accedere ad un database con asp Classic ASP 1
I Accedere a cartelle protette sul server attraverso internet? Windows e Software 5
P non posso accedere Supporto Mr.Webmaster 6
D Risultati diversi elaborazione dati fra localhost e Altervista PHP 0
S Sito Wordpress creato in localhost PHP 1
W [PHP] esco ad in stallare bcompiler su localhost Ampps in Win10 PHP 0
ICTSM [PHP] Collegamento a database non localhost PHP 3
P localhost e sqlserver su win7 Web Server 3
A Access denied for user ''@'localhost' PHP 1
L Xampp su Windows 8.1: localhost rifiuta la connessione Web Server 5
K mail() [function mail]: failed to connect to mailserver at localhost port 25 PHP 1
F Oggetto non trovato! IE, Chrome in localhost PHP 3
L problema siti web in localhost . PHP 5
matrobriva Impossibile connettersi al server localhost. PHP 9
T IIS attivo ma errore su http://localhost Classic ASP 1
I passaggio variabili tra due cartelle in localhost PHP 8
D Access denied for user '**********'@'localhost' (using password: NO) PHP 6
F Impostazione browser localhost Windows e Software 0
V problemi con localhost ed immagini Hardware 0
P Collegare 2 Pc a localhost PHP 5

Discussioni simili