nginxからデフォルトWebページを取得しようとしていますが、コンテナが実行中です。nginx:0.0.0.0:80に[emerg] bind()が失敗しました(98:アドレスは既に使用中)
私は以下のように私が撮った1.9.9
のステップがあるドッキングウィンドウを実行しています:
私はドッカーはこのことをファイルを作成:
FROM ubuntu:15.10
RUN echo "Europe/London" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update
RUN apt-get install -y nginx
RUN apt-get install -y supervisor
RUN apt-get update && apt-get -q -y install lsof
RUN apt-get install net-tools
RUN apt-get install psmisc
RUN apt-get -y install curl
ADD supervisor.nginx.conf /etc/supervisor.d/nginx.conf
CMD /usr/bin/supervisord -n
RUN rm -Rf /etc/nginx/conf.d/*
RUN rm /etc/nginx/sites-enabled/default
RUN mkdir /etc/nginx/logs/
RUN touch /etc/nginx/logs/error.log
RUN mkdir /usr/share/nginx/logs/
RUN touch /usr/share/nginx/logs/error.log
ADD ./conf/nginx.conf /etc/nginx/sites-available/default
RUN ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
copy ./dist /usr/share/nginx/html
CMD /usr/bin/supervisord -n
ドッカ・ファイルのコピーnginxの設定ファイルを下に/etc/nginx/sites-available/default
に入り、/etc/nginx/sites-enabled/default
のこのファイルへのシンボリックリンクを作成します。
server {
root /usr/share/nginx/html;
index index.html index.htm;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 5d;
}
# deny access to . files, for security
#
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
}
私は、その後で画像を建て:私は、IPアドレスを発見し、
curl http://172.17.0.2
を接続しようとした
docker run --name d3 -d -p 80:80 dnginx
:私はコンテナを開始し
docker build -t dnginx
返されたのは
をタイムアウトになりました:カール:(7)172.17.0.2のポート80への接続に失敗しました:操作は私は容器の中にbashシェルを開いて、返された
nginx
を走った
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
私はnetstat --listen
を実行した場合、私は得る:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:80 *:* LISTEN
私はを実行した場合私が取得:
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN -
私は何が起こっているのか全く見当がつかない。
nginxイメージに接続すると同じことが起こります。
が管理し、コンテナ内のすべてのプロセスがフォアグラウンドで実行されなければならないようですポート80で? – mgaido
私が手:TCP 0 0 *:HTTP *:* LISTEN – dagda1
は、これはあなたのポート80でリッスンし何か... – mgaido