Tag: maven

在Kubernetes上部署Lagom微服务

我正在试图通过跟踪Chirper Lagom示例来部署Kubernetes上的Lagom微服务。 所以根据提供的指导链接 ,我通过安装Minikubeconfiguration了一个kubernetes集群,一切都很好。 但是当我试图通过使用fabric8的docker-maven-plugin构buildChirper Docker镜像时,我得到了这个错误: [错误]无法执行目标io.fabric8:docker-maven-plugin:0.20.1:build(default-cli)上的项目friend-impl:目标io.fabric8的执行默认cli:docker-maven-plugin:0.20 .1:构build失败:没有给定,没有DOCKER_HOST环境variables,没有读/写'/var/run/docker.sock'或'//./pipe/docker_engine',没有外部提供者如Docker机器configuration – > [帮助1] 有没有人可以帮助我理解这个错误? 谢谢。

生成PDF PDFBox无头泊坞窗容器失败

我正在使用pdfbox在Java中创buildpdf。 从我的Mac作为普通的Java应用程序运行时,这工作正常。 然而,用例是从服务器端运行这个从Web浏览器生成PDF。 我已经将应用程序部署到docker容器,现在无法工作(加载字体时的各种错误 – arrayindexoutofbounds,eofexception等)。 这似乎是由于pdfbox在java.awt.headless模式下运行的方式,因为当我输出在Mac上运行的模式时,它将为无头模式返回false,而在服务器上返回true。 我在代码中明确地设置了java.awt.headless=fals e设置,现在又出现了一些其他的错误。 缺less与X服务器等有关的图书馆我已经安装了这些,但现在有错误: java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable. 围绕SO等有一些build议,例如设置DISPLAY =:0.0等,但这些都没有工作。 在Docker容器中运行显然有些复杂,但任何人都可以在这里提出一些build议吗? 我猜测使用虚拟xserver是答案,但我很难设置这个,然后设置适当的xsessionAuthoriy / DISPLAY /等

docker上的黄瓜testing不会在整合testing阶段触发

我有一些问题让我的黄瓜/ phantomJstesting运行对docker集装箱。 我的计划是在maven预集成testing阶段启动tomcat docker容器。 然后在整合testing阶段,我想运行黄瓜testing。 为此,我已经禁用了surefire插件来运行testing阶段,并包含故障安全插件。 尽pipe一些如何整合testing阶段什么都不做。 我不知道什么是错的。 docker容器工作正常,并在预集成testing阶段开始。 他们也停止在整合后testing阶段。 战争部署和运行就像运行。 那里没有问题。 当validation插件启用testing时,黄瓜testing运行在testing阶段。 在示例项目中,您可以通过在tofire的插件部分编辑pom来更改此项目 <configuration> <skip>true</skip> </configuration> 我已经在https://github.com/abroer/cucumber-integration-test.git创build了一个示例项目 该项目可以使用mvn clean verify来运行 有关如何在maven整合testing阶段启动黄瓜testing的build议。

春季启动docker插件需要每次删除图像

我创build了一个基本的spring启动应用程序,我正在使用docker-maven-plugin来构builddocker镜像。 每当我改变应用程序,我必须删除容器,并再次启动。 docker rm -f <container-name> docker run -p 8080:8080 -d <IMAGE> –name some-app 有什么方法可以重新启动容器,新的更改生效。 这是我的pom文件中的docker插件。 <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.2.3</version> <configuration> <imageName>${docker.image.prefix}/${project.artifactId}</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> Dockerfile FROM java:8 VOLUME /tmp ADD demo-0.0.2-SNAPSHOT.jar basic-boot-app.jar RUN bash -c 'touch /basic-boot-app.jar' ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/basic-boot-app.jar"]

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 […]

fabric8 docker-maven-plugin capAdd失败,出现“未知能力添加”

上下文 :尝试设置一个自动化集成testing套件,maven可以在CI服务器上运行testing之前和之后启动和停止docker映像。 由于广泛的文件,决定与fabric8结盟。 fabric8io.github.io/docker-maven-plugin/docker-start.html说 cap添加一个添加元素列表来指定要添加到容器的内核参数。 我假设语法与ADD local-artifact-version.jar app.jar类似,但是这不起作用。 问题 :当我运行mvn clean package docker时:build docker:start -Ddocker.follow = true我得到一个错误io.fabric8.maven.docker.access.hc.http.HttpRequestException: Cannot start container [sha1]: Unknown capability to add "target/artifact-1.0.0-SNAPSHOT-exec.jar app.jar" 当使用fabric8 docker maven插件时Dockerfile的“ADD”语义的正确用法是什么? pom : <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> <configuration> <image> <name>postgres:9.4</name> <alias>dbstore</alias> <run> <namingStrategy>alias</namingStrategy> <volumes> <bind>/var/lib/postgresql/data</bind> </volumes> </run> </image> <image> <name>private-dockerhub.company.com/dbpath/postgres:latest</name> <alias>data_dump_loader</alias> <run> […]

jenkinsdocker插件工作“权限被拒绝”的错误

我在Ubuntu 14.04机器上安装了CI环境,安装了Jenkins,Gitlab和docker runtime。 我configuration了一个项目myproject-hello-world(一个java / maven项目)和一个相应的jenkins作业,包含调用以下目标 (in Jenkins > myproject-hello-world job configuration page) Invoke top-level Maven targets clean package docker:build -DskipTests jenkins的工作失败,出现以下错误: [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (default-cli) on project myproject-hello-world: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.newsclub.net.unix.AFUNIXSocketException: Permission denied (socket: /run/docker.sock) -> [Help 1] (see below for the whole console log) 如果我只留下maven的clean package任务(即,删除docker:build插件,并保持其他一切不变),项目build设没有问题,所以我非常确定我的Jenkins + Jdk […]

Docker :: Dockerfile问题 – 目标文件夹不可用

我有一个春季启动项目,并试图在circleci持续集成服务器上使用Docker文件构build项目。 问题是,我只有我的github回购我的源代码; 没有目标目录或jar文件。 我的Dockerfile无法获得最终的工件(将应用程序打包成jar)。 请检查Docker文件并提出一个前进的方向。 FROM java:8 EXPOSE 8090 VOLUME /tmp ADD target/spring-boot-rest-0.3.0.jar app.jar RUN bash -c 'touch /app.jar' ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=container","-jar","/app.jar"]

在父pom构build的最后端运行docker-maven-plugin

我正在尝试构build包含构build父POM文件期间构build的一组.jar文件的docker映像。 直到现在我发现的情况是,特定模块的单个构build创build单独的泊坞窗图像。 我的docker形象包含卡拉夫部署捆绑。 在某个时候,我实现了创builddocker工人,但是当一切都build立起来的时候。 恐怕docker-maven-plugin可能不支持我想从bundle的特定文件夹(每个子项目正在将其捆绑包部署到特定文件夹)创builddocker镜像的情况。 现在我发现,父POM包types只支持三个阶段,但无论如何 – 所有这些都是在构build期间作为第一个项目运行。 所以问题是: 是否有可能创builddocker图像 包含在构build父POM项目期间构build的部署到一个文件夹的所有包 运行一些家长POM目标后自动运行 母体POM的某些部分最终可能与我的需求无关 <build> <plugins> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <inherited>false</inherited> <version>0.4.10</version> <configuration> <imageName>test1</imageName> <dockerDirectory>../karaf-deploy</dockerDirectory> <resources> <resource> <targetPath>../karaf-deploy/</targetPath> <directory>../karaf-deploy/</directory> <include>${project.build.finalName}.jar</include> </resource> </resources> </configuration> </plugin> </plugins> </build>

Docker容器中的jHipster中的Maven-Wrapper:FileNotFoundException

我在一个运行在lubuntu 16.4上的虚拟机中安装了docker。 之后,我按照本教程拉出容器jijster / jijster 。 使用docker exec -it jhipster bash访问它可以正常工作,也可以通过yo jhipster创build应用程序。 但是当我想通过./mvnw使用maven包装来运行它时,会发生以下错误(在一秒之后): Downloading https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.3.9/apache-maven-3.3.9-bin.zip Exception in thread "main" java.io.FileNotFoundException: /home/jhipster/.m2/wrapper/dists/apache-maven-3.3.9-bin/2609u9g41na2l7ogackmif6fj2/apache-maven-3.3.9-bin.zip.part (No such file or directory) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.<init>(FileOutputStream.java:213) at java.io.FileOutputStream.<init>(FileOutputStream.java:162) at org.apache.maven.wrapper.DefaultDownloader.downloadInternal(DefaultDownloader.java:69) at org.apache.maven.wrapper.DefaultDownloader.download(DefaultDownloader.java:60) at org.apache.maven.wrapper.Installer.createDist(Installer.java:64) at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:121) at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:50) 在容器内部似乎没有安装maven,但这是mvnw的目的,对不对? 无论如何,由于缺乏su权限(sudo没有find,只能从terminal“su”工程),我自己(在容器内)安装maven是不可能的。 我在这里没有得到什么错…你能帮忙吗? PS:.m2目录是空的。