Tag: dockerfile

docker工人raspbian lighttpd容器不工作

我正在尝试创build一个php ligttpd docker容器,它提供了一个显示其主机的hello worldtypes的页面。 我成功地启动了我的树莓派这个页面,但是当我尝试运行我的容器版本容器返回错误退出255 我正在运行的命令是lighttpd -D -f /etc/lighttpd/lighttpd.conf Dockerfile FROM resin/rpi-raspbian # Update system and install nginx webserver and php RUN apt-get update && \ apt-get upgrade && \ apt-get -y install lighttpd && \ apt-get install -y php5-common php5-cgi php5 && \ lighty-enable-mod fastcgi-php # Add required files COPY www/* /var/www/html COPY run.sh […]

泊坞窗:谷歌表最小的例子错误

我有一个烧瓶的应用程序,从谷歌表中提取一些数据。 当我在本地机器上运行烧瓶应用程序时,最初它是通过0auth2validation创build证书并将其存储在本地。 在本地应用程序成功完成之后,我在Docker容器中创build了相同的应用程序。 情况1 该容器具有在创build容器时复制/添加的凭证。 在这种情况下,烧瓶应用程序没有任何问题 情景2 该容器目前没有凭证文件。 所以,它必须通过调用get_credentials()函数来生成文件。 此时,网页浏览器停留在等待服务器的响应(浏览器处于加载阶段) 情况2是问题。 希望可以有人帮帮我 .. 我正在关注这个文档 。 Dockerfile FROM python:2.7-slim WORKDIR g_api ADD . /g_api RUN pip install -r requirements.txt EXPOSE 8000 泊坞窗,compose.yml version: "3" services: web: build: context: . dockerfile: Dockerfile command: "python g_api.py" ports: – "8000:8000" networks: – webnet volumes: – .:/g_api networks: webnet: requirements.txt […]

这个docker服务是否暴露在互联网上?

我有一套在DigitalOcean主机上运行的docker服务(由docker-compose编排)。 摘自我docker-compose.yml : web: build: backend_api_using_db ports: – "80:80" depends_on: – db db: image: postgres ( 完整版本在这里 ) 请注意,Docker Hub上的postgres映像描述提到它的Dockerfile有一个EXPOSE 5432 (postgresql的默认端口),这就是为什么我的web服务可以成功连接到它。 是否有可能从主机(互联网)之外直接连接到我的postgres数据库? 那么从内部(ssh-> localhost)呢? 我问这是因为我想知道如果我的postgres密码公开共享会有多糟糕。 攻击者可以使用它来访问我的数据库吗?

Dockerfile COPY命令在Docker-compose中没有像预期的那样工作

我试图通过docker-compose运行Nginx来执行Node.js后端的负载均衡。 我试过的方法: 在docker-compose.yml中写入所有configuration,同时按如下方式传递nginx.conf作为卷: version: '3' services: #nginx nginx: image: nginx container_name: books-nginx ports: – 80:80 links: – node1:node1 – node2:node2 – node3:node3 volumes: – ./nginx/nginx.conf:/etc/nginx/nginx.conf # Back-end node1: image: node container_name: books-api1 ports: – 3000 volumes: – ./books-backend:/app links: – mongodb environment: – admin=admin-password – secret=strong-password command: bash -c "cd /app && npm install && […]

如何编写Dockerfile来更改Docker镜像中的受保护文本文件?

我有一个Dockerfile,遵循这种模式: RUN echo "[DOCKER BUILD] Installing image dependencies…" && \ apt-get update -y && \ apt-get install -y sudo package_names … RUN useradd -ms /bin/bash builder # tried this too, same error # RUN useradd -m builder && echo "builder:builder" | chpasswd && adduser builder sudo RUN mkdir -p /home/builder && chown -R builder:builder /home/builder […]

在Docker容器中通过curl(smpt)发送电子邮件

我可以在本地使用以下脚本接收电子邮件 rtmp_url="smtp://smtp.xxx.com:25" rtmp_from="noreply@xxx.com" rtmp_to="receiver-email@xxx.com" file_upload="mail.txt" echo "From: $rtmp_from To: $rtmp_to Subject: example of mail Cc: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=\"MULTIPART-MIXED-BOUNDARY\" –MULTIPART-MIXED-BOUNDARY Content-Type: multipart/alternative; boundary=\"MULTIPART-ALTERNATIVE-BOUNDARY\" –MULTIPART-ALTERNATIVE-BOUNDARY Content-Type: text/plain; charset=utf-8 Content-Disposition: inline This is an email example. This is text/plain content inside the mail. –MULTIPART-ALTERNATIVE-BOUNDARY– –MULTIPART-MIXED-BOUNDARY Content-Type: application/octet-stream; Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=\"logs.txt\"" > ./mail.txt cat ./mail.txt […]

sbt-native-packager scala play dockerfile没有运行默认configuration

我正在尝试使用sbt-native-packager来生成我的Scala应用程序的Docker镜像,我遵循了http://www.scala-sbt.org/sbt-native-packager/formats/docker中描述的步骤html的 这是我的configuration: 在我的plugins.sbt我添加了sbt本地包装器的依赖关系: // SBT Native addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.1") 在我的build.sbt我添加了通用和docker的插件: .enablePlugins(PlayScala, JavaAppPackaging) 我还添加了一些额外的属性: javaOptions in Universal ++= Seq( // JVM memory tuning "-J-Xmx1024m", "-J-Xms512m", // Since play uses separate pidfile we have to provide it with a proper path // name of the pid file must be play.pid s"-Dpidfile.path=/var/run/${packageName.value}/play.pid", // Use separate configuration […]

我有一个docker图像,只在亚马逊linux上失败

我在本地机器上创build了一个Docker镜像,但是当我每次尝试运行时都上传到远程机器(Amazon Linux)时,它会返回standard_init_linux.go:178: exec user process caused "no such file or directory"我不知道问题出在哪里,有人可以帮我吗? 这是我的dockerfile: # Use an official Golang runtime as a parent image FROM golang:1.8-alpine # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app ADD . /app # Run weatherai when the container launches ENTRYPOINT […]

部署在docketed容器中后,http://0.0.0.0:8080上没有显示Mule项目

Mule容器按照以下日志运行 :细节在代码块中。 INFO 2017-08-20 14:53:50,580 [WrapperListener_start_runner] org.mule.runtime.module.launcher.MuleContainer: ********************************************************************** * Mule Runtime and Integration Platform * * Version: 4.0.0-BETA.4 Build: c03a2009 * * MuleSoft, Inc. * * For more information go to https://developer.mulesoft.com/ * * * * Server started: 8/20/17 2:53 PM * * JDK: 1.8.0_131 (mixed mode) * * OS: Linux (4.4.0-1022-aws, amd64) * * […]

Docker:获取部署在Tomcat上的特定于服务的日志

所以我已经和Tomcat一起docker化了一个服务“ myxxx-service ”。 Dockerfile : FROM tomcat:8-jre8 EXPOSE 8080 COPY ./myxxx-service/target/myxxx-service-1.0-SNAPSHOT.war /usr/local/tomcat/webapps cmd mkdir -p /opt/myxxx/db copy ./myxxx-service/src/test/resources/* /opt/myxxx/db/ CMD ["catalina.sh", "run"] 当我运行docker镜像时,我能够得到catalina.out日志。 tomcat成了。 我可以在8080端口上打开标准的tomcat页面。 但我的服务显示404错误响应。 我想检查通常在logs / myxxx-service.logs文件中的服务特定日志。 有没有办法做到这一点? 注:我已经尝试docker service logs 。 我不确定这是否有效。