泊坞窗容器中运行,但没有响应为localhost:49153

问题描述:

我做的周围使用Ubuntu,为此我已经下文提到Dockerfile泊坞窗容器中运行,但没有响应为localhost:49153

FROM ubuntu:14.04 
MAINTAINER Paresh Bhavsar "[email protected]" 
ENV REFRESHED AT "04-06-2015" 
RUN apt-get update 
RUN apt-get -y -q install nginx 
RUN mkdir -p /var/www/html 
ADD nginx/global.conf /etc/nginx/conf.d/ 
ADD nginx/nginx.conf /etc/nginx/nginx.conf 
EXPOSE 80 

nginx.conf文件nginx的成分POC ---

user www-data; 
worker_processes 4; 
pid /run/nginx.pid; 
daemon off; 
events { } 
http { 
    sendfile on; 
    tcp_nopush on; 
    tcp_nodelay on; 
    keepalive_timeout 65; 
    types_hash_max_size 2048; 
    include /etc/nginx/mime.types; 
default_type application/octet-stream; 
    access_log /var/log/nginx/access.log; 
    error_log /var/log/nginx/error.log; 
    gzip on; 
    gzip_disable "msie6"; 
    include /etc/nginx/conf.d/*.conf; 
} 

global.conf文件

server { 
     listen   0.0.0.0:80; 
} 
root   /var/www/html/website; 
index index.html index.htm; 

码头集装箱正在运行,显示如下所述。

CONTAINER ID  IMAGE      COMMAND    CREATED    STATUS    PORTS     NAMES 
9e32a617896a  pbhavsar211/nginx:latest "nginx"    15 minutes ago  Up 15 minutes  0.0.0.0:49163->80/tcp website  

我无法显示页面本地主机:49153,尝试与IP地址也没有运气。

我在这里错过了什么。提前致谢。

+0

你尝试49163?看起来像一个错字... –

+0

这是通过boot2docker? – resultsway

+1

我想像往常一样,阿德里安是对的,但你可以通过打开终端“docker exec -it 9e3 bash”来调试,然后用netstat或其他任何东西 – user2915097

我相信,根和指数statments必须在您global.conf文件服务器标签内,如下:

server { 
    listen   0.0.0.0:80; 
    root   /var/www/html/website; 
    index index.html index.htm; 
}