简体   繁体   English

Windows 10上的Docker与Maven

[英]Docker on Windows 10 with Maven

Try to run docker automated tests with Maven on Windows 10. There are many issues with Windows 10 and docker. 尝试在Windows 10上使用Maven运行docker自动化测试.Windows 10和docker存在许多问题。 Our code run great on Mac or Linux. 我们的代码在Mac或Linux上运行良好。

I run it from the Powershell but getting same issue from terminal (CMD) 我从Powershell运行它但从终端(CMD)获得相同的问题

It looks like a permission problem with Win10 for local shared folders but I am not sure. 对于本地共享文件夹,它看起来像Win10的权限问题,但我不确定。

VirtualBox 5.0.6 VirtualBox 5.0.6

Docker version 1.8.2, build 0a8c2e3 Docker版本1.8.2,构建0a8c2e3

The Maven plugin Maven插件

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.jolokia</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <version>0.13.5</version>
        </plugin>
    </plugins>
</pluginManagement>

This is the error: 这是错误:

[ERROR] ←[31mDOCKER> invalid mode for volumes-from: /opt/myapp (Internal Server Error: 500)←[m
[ERROR] ←[31mDOCKER> Error occurred during container startup, shutting down...←[m

did anyone come across this error on Windows 10? 有人在Windows 10上遇到过这个错误吗?

So after a long few weeks of rebuilding windows back to 8.0, 8.1 and 10 there are few tips for anyone trying the same tricks. 因此,经过长达数周的重建窗口重新回到8.0,8.1和10之后,对于任何尝试相同技巧的人来说,都有一些提示。

The error is because Docker doesn't have permissions to the drive I was running maven from. 错误是因为Docker没有权限我正在运行maven的驱动器。

  1. Download VM and Git independently. 独立下载VM和Git。 When installing docker unselect the two from the automatic override. 安装docker时,从自动覆盖中取消选择这两个。
  2. dont install Kitematic. 不要安装Kitematic。 It doesnt work most of the time 它大部分时间都不起作用
  3. Docker user has access to the user folder only, normally under C:Users\\your-name/... you should run all mvn commands from that folder or sub-folder Docker用户只能访问用户文件夹,通常在C:Users \\ your-name / ...下,您应该从该文件夹或子文件夹运行所有mvn命令
  4. docker ver 1.8.3 or later docker ver 1.8.3或更高版本
  5. Win 10 works well, CMD & Powershell. Win 10运作良好,CMD和Powershell。 I personally prefer powershell as it have more features. 我个人更喜欢powershell,因为它有更多的功能。
  6. Make sure to close the VM properly after a session before reboot 确保在重新启动之前的会话后正确关闭VM

    docker-machine stop (instance) docker-machine stop(实例)

  7. I normally add 2 CPU and 8GRam to my VM, it makes Docker run faster and less likely to crash when running few containers. 我通常会向我的VM添加2个CPU和8个GRAM,这使得Docker运行速度更快,并且在运行少量容器时不太可能崩溃。 Like 8 mysql instances. 像8个mysql实例一样。

good luck! 祝好运!

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

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