Docker日志文件没有创build
尝试使用指南在https://github.com/spotify/docker-maven-plugin和Spring启动泊坞窗指南中构buildmaven-docker项目: https : //spring.io/guides/gs/spring-boot-docker/
当我运行$ mvn clean package docker:build
从'Docker Quickstart Terminal'build我收到错误:
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.3.9:build (default-cli) on project functionrepo: Exception caught: Request error: POST https://192.168.99.100:2376/build?t=functionrepo: 500: HTTP 500 Internal Server Error -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
指南中解释了这个错误:
InternalServerErrorException:HTTP 500内部服务器错误
问题:在构buildDocker镜像时,Maven使用如下的堆栈跟踪输出exception:
由于:com.spotify.docker.client.shaded.javax.ws.rs.InternalServerErrorException:HTTP 500内部服务器错误docker-maven-plugin使用HTTP远程API与守护程序遇到的任何意外错误与本地Docker守护进程进行通信将被报告为500内部服务器错误。
检查Docker守护进程日志(通常位于/var/log/docker.log或/var/log/upstart/docker.log)以获取更多详细信息。
但是我找不到docker.log文件,似乎没有创build。 我已经search整个Windows系统的这个文件。
我可以使用“Docker快速入门terminal”进行构build还是需要将我的项目加载到Docker虚拟机中并从那里构build?
如何解决这个问题或打开日志?
这是我的configuration文件:
<plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.3.9</version> <configuration> <imageName>functionrepo</imageName> <dockerDirectory>src/main/docker</dockerDirectory> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>${project.build.finalName}.jar</include> </resource> </resources> </configuration> </plugin> [..] <properties> <!-- The main class to start by executing java -jar --> <start-class>common.WebApplicationDriver</start-class> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <java.version>1.8</java.version> <docker.image.prefix>springio</docker.image.prefix> </properties>
更新:
$ docker-machine active default $ docker-machine env default export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="C:\Users\aR\.docker\machine\machines\default" export DOCKER_MACHINE_NAME="default" # Run this command to configure your shell: # eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env default)
运行: $ mvn clean package docker:build
返回相同的错误
更新2:
我遇到了这个bug: https : //github.com/docker/docker-py/issues/730修复重命名的DockerFile到dockerfile
但是我找不到docker.log文件,似乎没有创build。 我已经search整个Windows系统的这个文件。
在Windows文件系统上查找该文件没有意义,因为Docker守护程序不能在Windows上运行。
在使用Docker Toolbox时 , Docker引擎 (或守护进程)将运行在使用VirtualBox创build的虚拟机中。 如果您正在查找此文件,则必须在该虚拟机文件系统中进行search。