Tag: Linux容器

应用程序/自定义日志魔术与docker上的php-fpm

我有一些基于stream明框架的PHP应用程序的基本设置。 该应用程序运行在php7.1 / php-fpm容器内的php7.1 / php-fpm 。 (Apache在其他docker容器中) 基本上,我需要的是从我的应用程序(使用monolog)直接login到stderr ,所以我可以看到他们与docker日志。 该应用程序configuration为login到stderr并正常工作,但FPM捕捉输出并将其写入文件! /var/log/php-fpm/error.log (它被configuration为在这里login?) [09-Nov-2017 10:06:56] WARNING: [pool www] child 303 said into stderr: "hello, world" [09-Nov-2017 10:06:56] WARNING: [pool www] child 300 said into stderr: "hello, world" [09-Nov-2017 10:06:57] WARNING: [pool www] child 359 said into stderr: "hello, world" 访问日志正确地进入stderr 。 而最好的部分: FPM 未configuration为logging到文件( error.log […]

gpgp密钥请求在dockerfile中失败,但不是bash

我有一个问题,当我build立我的docker集装箱时,尝试接收gpg密钥失败。 我正在提供的命令在命令行执行时正常工作。 我在防火墙后面; 我有下面这个详细的代理设置。 主持人:CentOS 7.4; Docker版本17.09.0-ce,编译afdb6d4 对于正在使用的帐户,没有为代理设置环境variables。 Docker服务具有根据Docker设置的代理的环境variables: 在/etc/systemd/system/docker.service.d/http-proxy.conf : [Service] Environment="HTTP_PROXY=http://<corporate proxy>/" "HTTPS_PROXY="<corporate proxy>/" "NO_PROXY=localhost,127.0.0.1,.domain.local,.corp" 我使用build.sh shell脚本来构build图像: #/bin/bash docker build -t hgk/test-container . shell脚本与我的Dockerfile位于相同的位置。 这是目录中唯一的两件事情。 FROM openjdk:8 ARG KEYSERV=hkp://p80.pool.sks-keyservers.net:80 ARG THEPROXY=<my corporate proxy> # grab gosu for easy step-down from root # (see docker-sonarqube pull request #115) RUN set -x \ && wget […]

docker-compose正试图访问proc文件

Docker-compose给了我这个错误,我不知道为什么: > docker-compose -f local.yml build Step 8/21 : RUN find . -type d -name __pycache__ -exec rm -r {} \+ —> Running in 9da1be4e2ae5 find: './proc/1/map_files': Operation not permitted find: './proc/6/map_files': Operation not permitted ERROR: Service 'base' failed to build: The command '/bin/sh -c find . -type d -name __pycache__ -exec rm -r {} […]

configurationmysql / mysql-server dockerfile的问题

我是第二年应用计算机科学专业的学生,​​在configurationmysql docker时遇到一些问题。 作为一个任务,我们必须创build2个docker图像(1与Apache / PHP和一个简单的PHP网页和另一个与MySQL)。 我已经创build了apache / php docker,这并不困难,但是我对mysql的一个很大的争议。 档 ./Dockerfile ./test.sql Dockerfile FROM mysql/mysql-server ENV MYSQL_ROOT_PASSWORD=lindert RUN mkdir /usr/sql RUN chmod 644 /usr/sql ADD test.sql /usr/sql/test.sql run MYSQL -u root -p${MYSQL_ROOT_PASSWORD} -e "CREATE DATABASE \ shippingdb" && mysql -u root -p${MYSQL_ROOT_PASSWORD} shippingdb < /usr/sql/test.sql 当我运行“dockerbuild设”。 这个错误popup: mysql: [WARNING] Using a password on the command […]

Docker使用主机系统构build一个代理

我想为Docker构build使用代理。 我检查这样的解决scheme: sudo docker build -t Cron/ubuntu \ –build-arg http_proxy="http://myproxy.example.com:8080" \ –build-arg https_proxy="https://myproxy.example.com:8080" \ 但在我的情况下,代理IP不是一个互联网地址,但从主机系统的一些IP如下:0.0.0.0: 0.0.0.0:8118 。 我–buid-arg我使用–buid-arg来构build镜像时,dockerfile运行到apt-get类的东西时,容器会尝试从docker系统中使用0.0.0.0:8118而不是主机系统。 而且由于我没有像主机系统那样为docker系统configurationip,代理将是无效的。 所以我的问题是,我怎么能运行docker build从主机系统docker build一个代理? 有一些方法来映射从主机到docker容器的IP?

如何解决'sudo:没有tty目前没有askpass程序指定'错误?

我正在尝试使用makefile编译一些源代码。 在makefile中有一些命令需要作为sudo运行。 当我从terminal编译源码时,一切正常,第一次sudo命令正在等待密码时,make将暂停。 一旦我input密码,恢复并完成。 但我希望能够在NetBeans中编译源代码。 所以,我开始了一个项目,并展示了netbeans在哪里可以find源代码,但是当我编译这个项目时,它会给出错误: sudo: no tty present and no askpass program specified 第一次命中sudo命令。 我已经在互联网上查找了这个问题,我发现的所有解决scheme都指向了一件事:禁用此用户的密码。 由于这里的用户是根。 我不想这样做。 有没有其他解决scheme?

在Docker和Ubuntu 16.04上安装HTK

我试图在Ubuntu 16.04中安装Docker中的HTK 。 我的Dockerfile是这样的: FROM ubuntu:16.04 # working directory ENV HOME /root WORKDIR $HOME # packages list RUN \ apt-get update && apt-get install -y \ libc6-dev-i386 \ libx11-dev \ gawk \ python-dev \ python-pip \ curl \ git # pip RUN pip install –upgrade pip # copy & install compat-gcc-34-c++ compat-gcc-34 COPY lib/*.deb $HOME/ […]

在redhat linux上安装docker – 用'container-selinux'和'selinux-policy'

我有EC2上的Linux,并试图安装Docker。 如何解决“container-selinux”和“selinux-policy”的问题? lsb_release -d Description: Red Hat Enterprise Linux Server release 6.9 (Santiago) sudo rpm -i container-selinux-2.9-4.el7.noarch.rpm warning: container-selinux-2.9-4.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY error: Failed dependencies: selinux-policy >= 3.13.1-39 is needed by container-selinux-2:2.9-4.el7.noarch selinux-policy-base >= 3.13.1-39 is needed by container-selinux-2:2.9-4.el7.noarch selinux-policy-targeted >= 3.13.1-39 is needed by container-selinux-2:2.9-4.el7.noarch

在带有Linux容器function的Windows 10版本1709上运行Portainer

当使用Docker for Windows 17.09 CE时,我可以在PowerShell控制台上运行以下代码: docker service create ` –name portainer ` –publish 9000:9000 ` –constraint 'node.role == manager' ` –mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock ` portainer/portainer ` -H unix:///var/run/docker.sock 现在我正在运行Windows 10版本1709我开始尝试使用启用了本机Linux容器function的Docker for Windows 17.11 CE。 运行此代码时,出现以下错误: invalid mount target, must be an absolute path: /var/run/docker.sock 我怎样才能解决这个问题? – 编辑: 我也尝试没有–mount指令: docker service create ` –name portainer ` –publish […]

在Docker教程中,localhost拒绝访问端口

我目前正在开始在我的大学提供的Linux VM上使用Docker。 要开始使用docker我正在做他们的教程( https://docs.docker.com/get-started/part2/#run-the-app )。 在创build这些文件之后,本教程将使用以下命令:docker run -p 4000:80 <name of container> 这应该容纳http:// localhost:4000上的容器,因为端口80被映射到4000.但不幸的是,当我去本地主机,这显示: 此网站不可用。 本地主机拒绝连接。 谢谢您的帮助!