Ubuntu用docker搭dvwa时卡在==> /var/log/apache2/other_vhosts_access.log <==不动

root@sn-virtual-machine:/home/sn# docker run --rm -it -p 80:80 vulnerables/web-dvwa
[+] Starting mysql...
[ ok ] Starting MariaDB database server: mysqld ..
[+] Starting apache
[....] Starting Apache httpd web server: apache2AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message
. ok
==> /var/log/apache2/access.log <==

==> /var/log/apache2/error.log <==
[Thu Jan 10 16:32:40.366684 2019] [mpm_prefork:notice] [pid 306] AH00163: Apache/2.4.25 (Debian) configured -- resuming normal operations
[Thu Jan 10 16:32:40.366794 2019] [core:notice] [pid 306] AH00094: Command line: '/usr/sbin/apache2'

==> /var/log/apache2/other_vhosts_access.log <==


Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
docker容器中通过/var/run/docker.sock挂载文件时,会在宿主机上创建同名目录,导致挂载失败(are you trying to mount a directory onto a file )。

1. 宿主机环境ubuntu 16.04, docker 17.12.0-ce, 通过/var/run/docker.sock把docker共享给jenkins容器. ``` docker run -u root -d -p 8080:8080 -v jenkins-data:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins ``` 在jenkins容器中启动docker-compose,配置文件如下: ``` nginx: image: nginx ports: - "80:80" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/Web:/home/docker/Web - ./nginx/codebase:/home/docker/codebase - static:/home/docker/static - media:/home/docker/media - logs:/home/docker/logs environment: - LANG=C.UTF-8 ``` 2. 执行后会报错: ``` mounting \\\"/var/jenkins_home/workspace/test/emqttd/acl.conf\\\" to rootfs \\\"/var/lib/docker/overlay2/e36922fe836d35b78435ba89ec2a4c9c7f3a5439ab9cd0d0d6a240cdbd938dab/merged\\\" at \\\"/var/lib/docker/overlay2/e36922fe836d35b78435ba89ec2a4c9c7f3a5439ab9cd0d0d6a240cdbd938dab/merged/opt/emqx/etc/acl.conf\\\" caused \\\"not a directory\\\"\"": unknown: Are you trying to mount a directory onto a file (or vice-versa)? ``` 同时宿主机器上,会创建出同名目录 ![图片说明](https://img-ask.csdn.net/upload/202003/31/1585634759_860795.jpg) 3. 请问为什么会在宿主机器上出现和挂载文件同名的目录?该文件不是应该仅出现在jenkins容器中吗?如何解决该问题?

如何基于对/var/run/docker.sock的临时访问授予Docker容器

<div class="post-text" itemprop="text"> <p>I would like to use the Docker socket on the host from Go code running inside a container based on scratch.</p> <p>The Dockerfile looks something like this:</p> <pre><code> FROM golang:1.12.4-alpine3.9 as builder RUN mkdir /user &amp;&amp; \ echo 'nobody:x:65534:65534:nobody:/:' &gt; /user/passwd &amp;&amp; \ echo 'nobody:x:65534:' &gt; /user/group RUN apk add --no-cache ca-certificates git WORKDIR /src COPY go.mod ./ RUN go mod download COPY . . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM scratch as final COPY --from=builder /user/group /user/passwd /etc/ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /src/app /app COPY --chown=nobody:nobody data /.local USER nobody:nobody ENTRYPOINT ["/app"] </code></pre> <p>The docker service itself includes a mount for the <code>/var/run/docker.sock</code></p> <p>Output from <code>docker service inspect</code>:</p> <pre><code> "Mounts": [ { "Type": "bind", "Source": "/var/run/docker.sock", "Target": "/var/run/docker.sock" } ], </code></pre> <p>Things I've tried:</p> <ol> <li><p><code>touch /var/run/docker.sock</code> on the <strong>builder</strong> and <code>COPY --chown=nobody:nobody --from=builder /var/run /var/run</code> in <strong>final</strong></p></li> <li><p>Different user (I refuse to run as root. It's bad practice).</p></li> <li><p>Adding nobody in <strong>final</strong> to the docker group.</p></li> </ol> <p>EDIT:</p> <p>Under this configuration I get the following error as <strong>nobody</strong> as a user does not have permission to access /var/run/docker.socket</p> <blockquote> <p>Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get <a href="http://%2Fvar%2Frun%2Fdocker.sock/v1.25/services" rel="nofollow noreferrer">http://%2Fvar%2Frun%2Fdocker.sock/v1.25/services</a>: dial unix /var/run/docker.sock: connect: permission denied</p> </blockquote> </div>

容器中挂载docker:/usr/bin/docker: 2: .: Can't open····

按照如下方式生成jenkins容器,并挂载docker: ``` docker run -d -p 8080:8080 --name jenkins -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock csphere/jenkins:1.609 ``` 容器正常启动,但是在容器中无法使用docker指令: ![图片说明](https://img-ask.csdn.net/upload/201711/24/1511526587_994728.png) 一开始以为是文件的权限问题,但是已经修改文件的权限仍无法解除bug

ubuntu下,docker启动问题,在使用service docker start之后提示 Starting Docker: docker 但是并没有启动成功

ubuntu下,docker启动问题,在使用service docker start之后提示 Starting Docker: docker 但是并没有启动成功。在docker version里面只有client 没有service ![图片说明](https://img-ask.csdn.net/upload/202005/22/1590119129_126325.png) 在使用各种命令的时候出现Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 我已经启动了docker 为什么还会出现这种问题? 我去查看了docker.sock 里面是空的。 怎么解决该问题!!!

docker-compose - Composer在/ var / www / html中找不到composer.json文件

<div class="post-text" itemprop="text"> <p>Trying to make docker container for my project and after using <code>docker-compose up --build</code> command I get this error: <code>Composer could not find a composer.json file in /var/www/html</code>.</p> <p>My Dockerfile:</p> <pre><code>FROM php:7.2-apache RUN docker-php-ext-install \ pdo_mysql \ &amp;&amp; a2enmod \ rewrite </code></pre> <p>.env file</p> <pre><code>#PATHS DB_PATH_HOST=./databases APP_PATH_HOST=./wedding-planner APP_PATH_CONTAINER=/var/www/html </code></pre> <p>part of docker-compose.yml</p> <pre><code> version: '3' services: web: build: ./web environment: - APACHE_RUN_USER=www-data [...] composer: image: composer:1.6 volumes: - ${APP_PATH_HOST}:${APP_PATH_CONTAINER} working_dir: ${APP_PATH_CONTAINER} command: composer install </code></pre> <p>Where should I put composer.json to make it work?</p> </div>

如何屏蔽/var/log/messages内的kubelet日志?

问题: * 由于公司监控平台监控了var/log/messages文件,kubelet日常error会频繁告警,已经做了kubelet日志重定向,如下: ``` [root@master ~]# cat /etc/sysconfig/kubelet KUBELET_EXTRA_ARGS=--logtostderr=false --log-dir=/var/log/kubernetes --v=0 ``` 将日志重定向到/var/log/kubernetes目录内,但是error日志还是会输出到var/log/messages文件,怎样才能让指定的kubelet日志不在messages文件内显示呢?

挑战性的Docker问题:如何干净删除手动安装的docker - ce?

工作环境:Ubuntu 18.04.1 因为docker自动的源老出问题,所以就选择了手动安装,过程出奇的简单,具体步骤: 1. 下载 docker-18.03.1-ce.tgz 2. 解压 tar xzvf docker-18.03.1-ce.tgz 3. cp docker/* /usr/bin/ 4. sudo docker run hello-world 所有网上可以查到的验证方法都可以通过, ``` sudo docker -v Docker version 18.03.1-ce, build 9ee9f40 ``` 安装了一个lamp Container ``` # service docker status ● docker.service - docker static Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-12-13 16:25:07 CST; 33min ago Main PID: 14560 (dockerd) Tasks: 47 (limit: 4915) CGroup: /system.slice/docker.service ├─14560 /usr/bin/dockerd ├─14567 docker-containerd --config /var/run/docker/containerd/containerd.toml ├─14828 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3307 -container-ip 172.17.0.2 -container-port 3306 ├─14840 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 81 -container-ip 172.17.0.2 -container-port 80 ├─14847 docker-containerd-shim -namespace moby -workdir /var/lib/docker/containerd/daemon/io.containerd.runtime.v1.linux/moby/886220dd45f02bf04d52f39d46af4dd5 ├─14864 /bin/bash ├─14995 /usr/sbin/apache2 -k start ├─15000 /usr/sbin/apache2 -k start ├─15001 /usr/sbin/apache2 -k start ├─15007 /usr/sbin/apache2 -k start ├─15008 /usr/sbin/apache2 -k start ├─15009 /usr/sbin/apache2 -k start ├─15010 /usr/sbin/apache2 -k start ├─15011 /usr/sbin/apache2 -k start ├─15012 /usr/sbin/apache2 -k start └─15013 /usr/sbin/apache2 -k start 12月 13 16:25:07 Dell dockerd[14560]: time="2018-12-13T16:25:07.246084925+08:00" level=warning msg="Your kernel does not support cgroup rt runtime" ``` docker ps -a; docker start lamp; docker stop lamp; 等命令都可以正常执行。 **但是这个安装无法正常卸载** ``` root@Dell:/home/work# apt-get remove docker docker-engine docker-ce docker.io 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 软件包 docker-engine 未安装,所以不会被卸载 软件包 docker-ce 未安装,所以不会被卸载 软件包 docker 未安装,所以不会被卸载 软件包 docker.io 未安装,所以不会被卸载 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 211 个软件包未被升级。 ``` **不知在此是否可以找到答案?** 其他相关信息: ``` $ sudo find / -iname docker /usr/bin/docker /run/docker /var/lib/docker /etc/docker /sys/fs/cgroup/pids/docker /sys/fs/cgroup/cpuset/docker /sys/fs/cgroup/memory/docker /sys/fs/cgroup/freezer/docker /sys/fs/cgroup/perf_event/docker /sys/fs/cgroup/blkio/docker /sys/fs/cgroup/hugetlb/docker /sys/fs/cgroup/cpu,cpuacct/docker /sys/fs/cgroup/net_cls,net_prio/docker /sys/fs/cgroup/devices/docker /sys/fs/cgroup/systemd/docker $ sudo find / -iname docker.service /etc/systemd/system/multi-user.target.wants/docker.service /sys/fs/cgroup/pids/system.slice/docker.service /sys/fs/cgroup/devices/system.slice/docker.service /sys/fs/cgroup/systemd/system.slice/docker.service /sys/fs/cgroup/unified/system.slice/docker.service /lib/systemd/system/docker.service ```

看到有些Ubuntu相关的Dockerfile里写的 rm -rf /var/lib/apt/lists/* 就什么意思

/var/lib/apt/lists/* 这个目录下的都是些什么文件,为什么每次新建Dockerfile都要删除呢?

如何在Docker容器中安装PHP的mod_rewrite模块?

<div class="post-text" itemprop="text"> <p>docker-compose.yml</p> <pre><code>version: "3.7" services: php: build: './php/' volumes: - ./public_html/www/:/var/www/html/ apache: build: './apache/' depends_on: - php - mysql ports: - "8080:80" volumes: - ./public_html/www/:/var/www/html/ #- ./log:/var/log/apache2 mysql: image: mysql:5.6.40 ports: - "3306:3306" environment: - MYSQL_DATABASE=el-cigarette - MYSQL_ROOT_PASSWORD=root phpmyadmin: image: phpmyadmin/phpmyadmin links: - mysql environment: PMA_HOST: mysql PMA_PORT: 3306 ports: - '8081:80' php/Dockerfile FROM php:7.0-apache MAINTAINER Webgriffe Srl &lt;support@webgriffe.com&gt; RUN docker-php-ext-install mysqli &amp;&amp; a2enmod rewrite apache/demo.apache.conf ServerName localhost LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so &lt;VirtualHost *:80&gt; # Proxy .php requests to port 9000 of the php-fpm container ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://php:9000/var/www/html/$1 DocumentRoot /var/www/html/ DirectoryIndex index.php &lt;Directory /var/www/html/&gt; Options All AllowOverride All Order allow,deny Allow from all Require all granted &lt;/Directory&gt; # Send apache logs to stdout and stderr CustomLog /var/www/1 common ErrorLog /var/www/2 &lt;/VirtualHost&gt; </code></pre> <p>I inputted next commands docker-compose build docker-compose up -d</p> <p>And I get that output Creating docker-local2_mysql_1 ... done Creating docker-local2_php_1 ... done Creating docker-local2_phpmyadmin_1 ... done Creating docker-local2_apache_1 ... done</p> <pre><code>Farther I write this docker exec -it docker-local2_php_1 sh # php -m But I didn't see mod_rewrite module [PHP Modules] Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqli mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules] </code></pre> <p>My .htaccess file doesn't work Where did I go wrong? And what I need do to fix this trouble?</p> </div>

docker安装gitlab容器无法启动

有哪位大神碰到过这种问题,docker安装gitlab容器无法启动 ``` # 拉取镜像 docker pull gitlab/gitlab-ce:latest # 运行容器 docker run --name='gitlab' -d \ --publish 1443:443 --publish 18080:80 \ --restart always \ --volume /root/docker/gitlab/config:/etc/gitlab \ --volume /root/docker/gitlab/logs:/var/log/gitlab \ --volume /root/docker/gitlab/data:/var/opt/gitlab \ --privileged=true \ gitlab/gitlab-ce:latest ``` 之后就是这样,执行docker start b50377f9618e后,刚启动就立马停止了 b50377f9618e gitlab/gitlab-ce "/assets/wrapper" About a minute ago Exited (1) About a minute ago gitlab

无法使用docker查看STDERR输出

<div class="post-text" itemprop="text"> <p>I'm running a php docker image (php:5.6-apache) which has apache's error and access logs redirected to STDERR and STDOUT respectively using symbolic links.</p> <p>When I run the docker image in the foreground or access the docker container logs, I can see the STDOUT output. But I don't see any errors (even when I generate php errors).</p> <p>Any idea why that is and how I can fix it?</p> <p>I'm running docker for Mac (but I don't think this makes any difference)</p> <p>Thanks</p> <pre><code>access.log -&gt; /dev/stdout error.log -&gt; /dev/stderr other_vhosts_access.log -&gt; /dev/stdout </code></pre> <p><strong>Edit / Solved:</strong> As @BMitch mentions and proves below, the STDERR redirection works fine. The problem was with PHP configuration. If I logged an error with <code>error_log()</code>, it would get output to the log. But if I had a php error, like calling an undefined function, the error would never appear in the log. This seems a little inconsistent. In any case, ...</p> <p>I had to create a <code>php.ini</code> file in <code>/usr/local/etc/php/</code> and add these two parameters:</p> <pre><code>log_errors = On error_log = /var/log/apache2/error.log </code></pre> <p>and then restart the docker container. This caused all PHP errors to be logged and output to STDERR. See @German's answer for an example.</p> </div>

Go在Docker容器中找不到/ usr / share / zoneinfo

<div class="post-text" itemprop="text"> <p>In a Go program I call <code>time.LoadLocation("Europe/Berlin")</code> and it returns an error saying <code>open /usr/local/go/lib/time/zoneinfo.zip: no such file or directory</code>, even though in the container (running <code>alpine:3.9</code> with tzdata installed) <code>/usr/share/zoneinfo/Europe/Berlin</code> exists and, according to the <a href="https://golang.org/pkg/time/#LoadLocation" rel="nofollow noreferrer">docs</a>, should take precedence over the zip file. The same program finds the file on my machine (Arch Linux). The executable got statically linked on my machine and then copied into the container. I tried Go 1.11.5 and 1.10.3.</p> <p>I built the executable with:</p> <pre><code>CGO_ENABLED=0 go build -a -ldflags "-s" -o gocake_static </code></pre> <p>I'm looking for any ideas that help me identify the problem.</p> </div>

docker ce 注册apt源时遇到问题

今天尝试安装docker最新社区版,在注册官方安装源的时候遇到问题。 按官方文档所述,已经安装好apt的https模块,下载并验证了证书。执行如下语句注册官方源 > sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" 执行后,/etc/apt/source.list如下: > …… deb [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable \# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable …… 此时执行更新命令apt-get update,报如下异常 > …… Ign https://download.docker.com trusty InRelease Ign https://download.docker.com trusty Release.gpg Ign https://download.docker.com trusty Release Err https://download.docker.com trusty/stable amd64 Packages Bad header line Ign https://download.docker.com trusty/stable Translation-en_US Ign https://download.docker.com trusty/stable Translation-en Fetched 68.8 MB in 2min 0s (574 kB/s) W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/trusty/stable/binary-amd64/Packages Bad header line E: Some index files failed to download. They have been ignored, or old ones used instead. 清除缓存(rm -Rf /var/lib/apt/lists/\*)后再次执行更新依然是上述异常。 谁有过类似问题解决经历或者解决思路,请不吝赐教!

在后台Docker容器中运行apache / php / nginx

<div class="post-text" itemprop="text"> <p>I am new to docker. I am trying to run a docker container running <code>Apache and PHP</code> or <code>PHP-FPM</code>.</p> <p>Like that </p> <pre><code>docker run -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache </code></pre> <p>And it attaches STDIN/STDOUT to my host machine </p> <pre><code>docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache </code></pre> <p>Seems to work fine, but I read that </p> <blockquote> <p>By design, containers started in detached mode exit when the root process used to run the container exits.</p> </blockquote> <p>Does it mean if I start container from remote ssh connection and then close it, the docker container will stop ? </p> <p>I am building my custom docker image based on the </p> <blockquote> <p>library/php/</p> </blockquote> <p>And I need my image to start automatically in background, not in foreground.</p> <p>How can I get this behavior ?</p> </div>

boot2docker start闪退问题

win10刚安装好的boot2docker start v1.8最新版本,一打开就会出现 initializing...WARNING: The 'boot2docker' command line interface (not to be confused with 'boot2docker' the operating system) is officially deprecated. Please switch to Docker Machine (https://docs.docker.com/machine/) ASAP. Docker Toolbox (https://docker.com/toolbox) is the recommended install method. Virtual machine boot2docker-vm already exists starting... WARNING: The 'boot2docker' command line interface (not to be confused with 'boot2docker' the operating system) is officially deprecated. Please switch to Docker Machine (https://docs.docker.com/machine/) ASAP. Docker Toolbox (https://docker.com/toolbox) is the recommended install method. Waiting for VM and Docker daemon to start... 然后就闪退了,试了很多遍都是这样,我是docker新人,不知道从何下手啊?求大神指点,谢谢。

用于Golang的Docker SDK无法连接到覆盖网络内部的守护程序

<div class="post-text" itemprop="text"> <p>I have a docker swarm, and a container inside of an overlay network on that swarm. The container has an app written in golang that interacts with the Docker API by creating a container and starting it. When I run my golang app on the host machine, everything runs perfect and it creates and runs the container without issue. However when I put the app into the container and run it in my overlay network, it no longer can reach the API. </p> <p>I'm assuming this has something to do with networking, but the idea of my project is that there are multiple services, each with their own networks, that can create, launch, and remove containers they see fit. NOT running the SDK in an app outside of the overlay networks unfortunately is not an option at this time.</p> <p>Error: <code>Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?</code></p> </div>

我如何才能适当地供应商github.com/docker/docker?

<div class="post-text" itemprop="text"> <p>here my main.go</p> <pre><code>package cmd import ( "context" "fmt" "github.com/docker/docker/api/types" "github.com/docker/docker/client" ) func main() { cli, err := client.NewClientWithOpts(client.WithVersion("1.38")) if err != nil { panic(err) } networks, err := cli.NetworkList(context.Background(), types.NetworkListOptions{}) if err != nil { panic(err) } fmt.Println(networks) } </code></pre> <p>i tried to run <code>dep init</code> but vendor folder ended up with an older version of docker/docker because the newest tag is 17.05 tried to pin the actual commit but that did not work either</p> <p>i give a shot to <code>go mod vendor</code> but that also rely on git tags</p> <p>Strangely enough docker/docker is an alias to moby/moby and docker/engine.</p> <p>Anyone could explain me and give example how can i successfully use vendoring with docker API?</p> </div>

Golang HTTP POST成功,但未调用docker操作

<div class="post-text" itemprop="text"> <p>Problem: Although I can easily issue GET and POST commands from curl on my local docker socket, when I try to do the POST equivalent in Golang for a docker pull action, using <code>net.Dial</code>, I see no action taken on Docker's behalf. </p> <p>Note that, meanwhile, the <code>GET</code> action works just fine using docker sockets via the golang client.</p> <p>For example, when running the code at the bottom of this post, I see:</p> <pre><code>2018/01/05 14:16:33 Pulling http://localhost/v1.24/images/create?fromImage=fedora&amp;tag=latest ...... 2018/01/05 14:16:34 Succeeded pull for http://localhost/v1.24/images/create?fromImage=fedora&amp;tag=latest &amp;{200 OK 200 HTTP/1.1 1 1 map[Docker-Experimental:[true] Ostype:[linux] Server:[Docker/17.09.0-ce (linux)] Api-Version:[1.32] Content-Type:[application/json] Date:[Fri, 05 Jan 2018 19:16:34 GMT]] 0xc42010a100 -1 [chunked] false false map[] 0xc420102000 &lt;nil&gt;} </code></pre> <p>The code for attempting to do a pull via a POST action: </p> <pre><code>// pullImage is the equivalent of curl --unix-socket /var/run/docker.sock -X POST http://localhost/images/create?fromImage=alpine func pullImage(img string, tag string) (err error) { fd := func (proto, addr string) (conn net.Conn, err error) { return net.Dial("unix", "/var/run/docker.sock") } tr := &amp;http.Transport{ Dial: fd, } client := &amp;http.Client{Transport: tr} imageUrl := fmt.Sprintf("http://localhost/v1.24/images/create?fromImage=%s&amp;tag=%s", img, tag) log.Printf("Pulling %s ...... ", imageUrl) resp, err := client.Post(imageUrl, "application/json", nil) if resp.StatusCode == 200 &amp;&amp; err == nil { log.Printf("Succeeded pull for %s %v",imageUrl, resp) } else { log.Printf("FAILED pull for %s , ERROR = (( %s )) ",imageUrl , err) } return err </code></pre> <p>Question: </p> <p>What does <code>curl --unix-socket /var/run/docker.sock -X POST http://localhost/v1.24/images/create?fromImage=fedora</code> do differently then the Golang code in the above snippet?</p> </div>

从上游读取响应头时,XDebug无法打开远程调试文件'/var/log/xdebug.log'

<div class="post-text" itemprop="text"> <p>I am using docker for developing, which worked without any problems at all until I had no space left on my disk (my Ubuntu partition is only 30G). So I deleted all containers and images which weren't running/used anymore and had enough space.</p> <p>After starting my application again, I'm now getting a <code>ContextErrorException</code> with the following message</p> <p><code>Warning: Header may not contain more than a single header, new line detected</code></p> <p>When I look into the <code>error.log</code>, this is the content</p> <pre><code>2017/04/29 12:53:13 [error] 13#13: *1 FastCGI sent in stderr: "PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'" while reading response header from upstream, client: 172.17.0.1, server: app, request: "GET /admin/dashboard HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080" 2017/04/29 12:53:24 [error] 13#13: *1 FastCGI sent in stderr: "PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'. PHP message: XDebug could not open the remote debug file '/var/log/xdebug.log'" while reading response header from upstream, client: 172.17.0.1, server: app, request: "GET /admin/dashboard HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost:8080" </code></pre> <p>I did the following steps in both environments (docker-container and host system)<br> I went into <code>/var/log/</code> and saw that there was no file <code>xdebug.log</code> so I created the file and - just for testing purpose - gave them <code>777</code> rights and changed the owner/group to the same as my project files/docker files</p> <p>The error still exists, however. I even deleted ALL container and images, not only the unused one, and built it completely from scratch. This doesn't seem like a Docker error, because it worked without problems until the disk space was full, right?</p> <p>This is the result of <code>php -i | grep xdebug</code></p> <pre><code>xdebug xdebug support =&gt; enabled xdebug.auto_trace =&gt; Off =&gt; Off xdebug.cli_color =&gt; 0 =&gt; 0 xdebug.collect_assignments =&gt; Off =&gt; Off xdebug.collect_includes =&gt; On =&gt; On xdebug.collect_params =&gt; 0 =&gt; 0 xdebug.collect_return =&gt; Off =&gt; Off xdebug.collect_vars =&gt; Off =&gt; Off xdebug.coverage_enable =&gt; On =&gt; On xdebug.default_enable =&gt; On =&gt; On xdebug.dump.COOKIE =&gt; * =&gt; * xdebug.dump.ENV =&gt; no value =&gt; no value xdebug.dump.FILES =&gt; no value =&gt; no value xdebug.dump.GET =&gt; * =&gt; * xdebug.dump.POST =&gt; * =&gt; * xdebug.dump.REQUEST =&gt; * =&gt; * xdebug.dump.SERVER =&gt; * =&gt; * xdebug.dump.SESSION =&gt; * =&gt; * xdebug.dump_globals =&gt; On =&gt; On xdebug.dump_once =&gt; On =&gt; On xdebug.dump_undefined =&gt; Off =&gt; Off xdebug.extended_info =&gt; On =&gt; On xdebug.file_link_format =&gt; no value =&gt; no value xdebug.force_display_errors =&gt; Off =&gt; Off xdebug.force_error_reporting =&gt; 0 =&gt; 0 xdebug.halt_level =&gt; 0 =&gt; 0 xdebug.idekey =&gt; php-debug =&gt; php-debug xdebug.max_nesting_level =&gt; 250 =&gt; 250 xdebug.max_stack_frames =&gt; -1 =&gt; -1 xdebug.overload_var_dump =&gt; On =&gt; On xdebug.profiler_aggregate =&gt; Off =&gt; Off xdebug.profiler_append =&gt; Off =&gt; Off xdebug.profiler_enable =&gt; Off =&gt; Off xdebug.profiler_enable_trigger =&gt; Off =&gt; Off xdebug.profiler_enable_trigger_value =&gt; no value =&gt; no value xdebug.profiler_output_dir =&gt; /tmp =&gt; /tmp xdebug.profiler_output_name =&gt; cachegrind.out.%p =&gt; cachegrind.out.%p xdebug.remote_addr_header =&gt; no value =&gt; no value xdebug.remote_autostart =&gt; Off =&gt; Off xdebug.remote_connect_back =&gt; Off =&gt; Off xdebug.remote_cookie_expire_time =&gt; 3600 =&gt; 3600 xdebug.remote_enable =&gt; On =&gt; On xdebug.remote_handler =&gt; dbgp =&gt; dbgp xdebug.remote_host =&gt; 192.168.0.10 =&gt; 192.168.0.10 xdebug.remote_log =&gt; /var/log/xdebug.log =&gt; /var/log/xdebug.log xdebug.remote_mode =&gt; req =&gt; req xdebug.remote_port =&gt; 9000 =&gt; 9000 xdebug.scream =&gt; Off =&gt; Off xdebug.show_error_trace =&gt; Off =&gt; Off xdebug.show_exception_trace =&gt; Off =&gt; Off xdebug.show_local_vars =&gt; Off =&gt; Off xdebug.show_mem_delta =&gt; Off =&gt; Off xdebug.trace_enable_trigger =&gt; Off =&gt; Off xdebug.trace_enable_trigger_value =&gt; no value =&gt; no value xdebug.trace_format =&gt; 0 =&gt; 0 xdebug.trace_options =&gt; 0 =&gt; 0 xdebug.trace_output_dir =&gt; /tmp =&gt; /tmp xdebug.trace_output_name =&gt; trace.%c =&gt; trace.%c xdebug.var_display_max_children =&gt; 128 =&gt; 128 xdebug.var_display_max_data =&gt; 512 =&gt; 512 xdebug.var_display_max_depth =&gt; 4 =&gt; 4 </code></pre> <p>Anyone got any idea?</p> </div>

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Intellij IDEA 实用插件安利

1. 前言从2020 年 JVM 生态报告解读 可以看出Intellij IDEA 目前已经稳坐 Java IDE 头把交椅。而且统计得出付费用户已经超过了八成(国外统计)。IDEA 的...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

魂迁光刻,梦绕芯片,中芯国际终获ASML大型光刻机

据羊城晚报报道,近日中芯国际从荷兰进口的一台大型光刻机,顺利通过深圳出口加工区场站两道闸口进入厂区,中芯国际发表公告称该光刻机并非此前盛传的EUV光刻机,主要用于企业复工复产后的生产线扩容。 我们知道EUV主要用于7nm及以下制程的芯片制造,光刻机作为集成电路制造中最关键的设备,对芯片制作工艺有着决定性的影响,被誉为“超精密制造技术皇冠上的明珠”,根据之前中芯国际的公报,目...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

差点跪了...

最近微信又搞出了一个大利器,甚至都上了热搜,当然消息最敏捷的自媒体人,纷纷都开通了自己的视频号。01 视频号是什么呢?视频号是微信体系内的短视频,它不同...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

Vue回炉重造之router路由(更新中)

你好,我是Vam的金豆之路,可以叫我豆哥。2019年年度博客之星、技术领域博客专家。主要领域:前端开发。我的微信是 maomin9761,有什么疑问可以加我哦,自己创建了一个微信技术交流群,可以加我邀请你一起交流学习。最后自己也创建了一个微信公众号,里面的文章是我自己精挑细选的文章,主要介绍各种IT新技术。欢迎关注哦,微信搜索:臻美IT,等你来。 欢迎阅读本博文,本博文主要讲述【】,文字通...

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大胆预测下未来5年的Web开发

在2019年的ReactiveConf 上,《Elm in Action》的作者Richard Feldman对未来5年Web开发的发展做了预测,很有意思,分享给大家。如果你有机会从头...

立即提问
相关内容推荐