简体   繁体   English

未创建Docker日志文件

[英]Docker log file not created

Attempting to build maven-docker project using guide at https://github.com/spotify/docker-maven-plugin and Spring boot docker guide : https://spring.io/guides/gs/spring-boot-docker/ 尝试使用https://github.com/spotify/docker-maven-plugin和Spring boot docker指南中的指南构建maven-docker项目: https : //spring.io/guides/gs/spring-boot-docker/

When I run $ mvn clean package docker:build from the 'Docker Quickstart Terminal' I recieve error : 当我从'Docker Quickstart Terminal'运行$ mvn clean package docker: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

This error is explained within guide: 该错误在指南中进行了解释:

InternalServerErrorException: HTTP 500 Internal Server Error InternalServerErrorException:HTTP 500内部服务器错误

Problem: when building the Docker image, Maven outputs an exception with a stacktrace like: 问题:构建Docker映像时,Maven输出带有堆栈跟踪的异常,例如:

Caused by: com.spotify.docker.client.shaded.javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error docker-maven-plugin communicates with your local Docker daemon using the HTTP Remote API and any unexpected errors that the daemon encounters will be reported as 500 Internal Server Error. 引起原因:com.spotify.docker.client.shaded.javax.ws.rs.InternalServerErrorException:HTTP 500内部服务器错误docker-maven-plugin使用HTTP Remote API与本地Docker守护程序通信,并且该守护程序遇到任何意外错误将报告为500 Internal Server Error。

Check the Docker daemon log (typically at /var/log/docker.log or /var/log/upstart/docker.log) for more details. 查看Docker守护程序日志(通常在/var/log/docker.log或/var/log/upstart/docker.log中)以获取更多详细信息。

But I cannot find the docker.log file, it does not seem to be created. 但是我找不到docker.log文件,它似乎没有创建。 I've searched entire Windows system for this file. 我已经在整个Windows系统中搜索了该文件。

Can I use 'Docker Quickstart Terminal' for building or do I need to load my project into the docker VM and build from there ? 我可以使用“ Docker快速入门终端”进行构建还是需要将项目加载到Docker VM中并从那里进行构建?

How to fix this issue or turn on logging? 如何解决此问题或打开日志记录?

Here is my maven config: 这是我的Maven配置:

<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>

Update : 更新:

$ 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)

Running : $ mvn clean package docker:build returns same error 运行: $ mvn clean package docker:build返回相同的错误

Update 2 : 更新2:

I encountered this bug : https://github.com/docker/docker-py/issues/730 to fix renamed DockerFile to dockerfile 我遇到了这个错误: https : //github.com/docker/docker-py/issues/730将重命名的DockerFile修复为dockerfile

But I cannot find the docker.log file, it does not seem to be created. 但是我找不到docker.log文件,它似乎没有创建。 I've searched entire Windows system for this file. 我已经在整个Windows系统中搜索了该文件。

There is no point looking for that file on your Windows file system because the Docker daemon does not run on Windows. 在Windows文件系统上寻找该文件毫无意义,因为Docker守护程序未在Windows上运行。

As you are using the Docker Toolbox , the Docker engine (or daemon) runs in a virtual machine created with VirtualBox. 当您使用Docker Toolbox时Docker引擎 (或守护程序)在使用VirtualBox创建的虚拟机中运行。 If you are looking for this file, you would have to search within that virtual machine file system. 如果要查找此文件,则必须在该虚拟机文件系统中搜索。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM