我想获取我的docker集装箱的主机名称, 因为我只能使用反向代理 ,我试图在nginx的帮助下完成。 一个docker集装箱是一个web服务,将端口8080暴露给我的本地主机。 所以我可以通过以下方式访问Web服务器: http://localhost:8080 相反,我宁愿要使用: http://webservice.local 因此,我添加到我的/etc/hosts 127.0.0.1 webservice.local 然后我安装了nginx并添加到/etc/nginx/sites-available/default : server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm; # Make site accessible from http://localhost/ server_name localhost; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying […]
是否有任何docker CLI命令将显示有关公共registry中的图像的所有信息(包括可用的图像版本)? 如果我最新的图像是最新的,我很乐意检查一下。 就目前而言,我只发现了不提供这种信息的search命令。
我有点困难,确定为什么nginx和uwsgi没有为我的django应用程序服务。 这是来自nginx日志的问题。 nginx-01: 2015/12/06 07:47:50 [error] 10#0: *1 connect() failed (111: Connection refused) while connecting to upstream, client: xxx.xxx.xxx.xxx, server: , request: "GET / HTTP/1.1", upstream: "uwsgi://0.0.0.0:8001", host: "54.252.197.191" 因此,uwsgi和django使用以下文件设置驻留在一个容器中。 [uwsgi] http-socket = :8001 chdir = %dsrc/myproject/ env = DJANGO_SETTINGS_MODULE=myproject.settings module = myproject.wsgi:application master = true processes = 4 我的docker文件启动uwsgi和我公开端口8001到主机 CMD ["uwsgi", "uwsgi.ini"] 我的第二个容器是nginx有以下nginx虚拟主机设置。 upstream […]
如果我使用标签/标签创build一个容器 docker run –name some_container -d me/my_image 用更新图像 docker pull me/my_image 并重新启动容器 docker restart some_container 新容器使用哪个版本? 在.Config.Image给出了特定图片的id, .Config.Image给出了标签。
我对Docker相当陌生,但是现在我已经为我的各种项目构build了一些图像,从而能够“手动”地完成任务。 Docker Hub具有很好的自动化构buildfunction,但价格昂贵。 如何复制该function?
我的项目即将在Docker上运行。 我今天发现准备在coreos.com上使用AWS CloudFormation堆栈( https://coreos.com/os/docs/latest/booting-on-ec2.html )我有点诧异,有可能selectPV因为 我对AWS的经验是HVM机器可以在停机后重新resize,这对PV机器是不可能的。 是否有一个性能障碍,我应该为CoreOSselectPV? 或者我应该留在HVM为更好的弹性?
我目前遇到的问题,jenkins是不可及的,如果我开始与前缀。 前缀是得到jenkins在myurl.de/jenkins(而不是myurl.de:8101)下可用。 我的configuration文件apache2 /etc/apache2/sites-available/000-default.conf包含: ProxyPass /jenkins http://localhost:8101/ nocanon ProxyPassReverse /jenkins http://localhost:8101/ ProxyRequests Off AllowEncodedSlashes NoDecode 如https://wiki.jenkins-ci.org/display/JENKINS/Running+Jenkins+behind+Apache中所述 。 如果我单独运行Jenkins: java -jar jenkins.war –httpPort=8101一切工作正常,除了调用myurl.de/jenkins只创build一个缺陷的一面,因为上下文path是错误的,例如图像,从错误的位置加载(从myurl.de/image.png代替myurl.de/jenkins/image.png)。 所以就像上面的链接中描述的那样,我已经用java -jar jenkins.war –httpPort=8101 –prefix=/jenkins启动了Jenkins java -jar jenkins.war –httpPort=8101 –prefix=/jenkins 。 不幸的是,它说: Running from: /home/dgr/jenkins2/jenkins.war webroot: $user.home/.jenkins Jan 29, 2016 2:25:50 PM winstone.Logger logInternal INFO: Beginning extraction from war file Jan 29, 2016 […]
我有一个应用程序在Ubuntu容器上使用Apache2 / Tomcat。 它在“/etc/init.d/apatomcat” 这是我的Dockerfile: 这是我在cmd上所做的尝试(包括-D选项与前景等)。 docker开始和附加 docker运行和执行 root@docker:~/tomcat-Docker/ubuntu# cat Dockerfile FROM ubuntu:14.04 ENV http_proxy 'http://wsa.corp.com:8000' ENV https_proxy 'http://wsa.corp.com:8000' ENV DEBIAN_FRONTEND noninteractive ENV apatomcat_DIR=/var/apatomcat/apatomcat/ RUN rm /bin/sh && ln -s /bin/bash /bin/sh COPY apt.conf /etc/apt/apt.conf RUN apt-get -y update RUN apt-get install -y vim python2.7 openjdk-7-jdk ssh ant CMD chmod a+rwx /etc/profile.d/apatomcat.sh COPY apatomcat.conf /etc/apatomcat/apatomcat.conf […]
无法使用docker构build容器 Docker version 1.9.1, build a34a1d5 Dockerfile FROM ubuntu # File Author / Maintainer MAINTAINER Parzee [email protected] # Install Components. # Update the repository ENV LANG en_US.UTF-8 ENV DEBIAN_FRONTEND noninteractive RUN apt-get update RUN locale-gen en_US en_US.UTF-8 # Install necessary tools RUN apt-get install -y nano vim wget dialog net-tools RUN apt-get install lighttpd -y […]
在按照如何让Jetty将httpredirect到https的build议后,我们能够使我们的独立Jetty部署将所有HTTP请求redirect到HTTPS。 然而,redirect是一个302.我们怎样才能使这个301(永久)redirect呢? 作为参考,我们将其添加到Jetty的etc / webdefault.xml中: <web-app> … <security-constraint> <web-resource-collection> <web-resource-name>Everything in the webapp</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> </web-app>