Questions tagged [docker-maven-plugin]

To be used with programming questions that uses docker-maven-plugin ( A Maven plugin for building and pushing Docker images )

The Docker Maven Plugin was the initial Maven plugin used at Spotify for building Docker images out of Java services. This plugin is capable of generating a Dockerfile for you based on configuration in the pom.xml file for things like the FROM image, resources to add with ADD/COPY, etc.

You can use this plugin to create a Docker image with artifacts built from your Maven project. For example, the build process for a Java service can output a Docker image that runs the service.

Note that the authors recommend that new projects use Dockerfile Maven Plugin instead.

73 questions
11
votes
4 answers

Why do I get "unzip: short read" when I try to build an image from Dockerfile?

From Spring Microservices in Action book: I am trying to use the Docker Maven Plugin to build a docker image for deploy a Java microservice as Docker container to the cloud. Dockerfile: FROM openjdk:8-jdk-alpine RUN mkdir -p…
lcnicolau
  • 3,252
  • 4
  • 36
  • 53
8
votes
3 answers

HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1] failed: Connection refused

[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default) on project Bookstore: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException:…
6
votes
0 answers

Maven 3: Accessing parent.parent.version from grandchild pom

I have a problem accessing parent.parent.version from grandchild pom. Here is the exact description of the problem: Parent…
Suman
  • 818
  • 6
  • 17
6
votes
0 answers

Resources are missing from JAR file after repackage with spring boot maven plugin

My application uses some additional files which I have inside the resource folder. When I do the regular build with Maven and package my app into JAR, I can see all my resources in case I unzip this archive. But when I create a docker image I use…
5
votes
1 answer

Fabric8 docker-maven-plugin unable set labels to an image

Using the following plugin io.fabric8 docker-maven-plugin 0.33
Sniper
  • 1,428
  • 1
  • 12
  • 28
5
votes
1 answer

How to pass private repository credentials to maven docker image when using Google Cloud Build

I am trying to use Google Cloud Build to build my Java app. It allows to use so called cloud builders - docker images of different builders. I am using Maven. So the problem is that I have to use a private repository (artifactory) to deploy…
5
votes
1 answer

docker-maven-plugin: how do I pass environment variable from `docker run ... -e ` to build or run step?

I have a .jar that contains multiple public static void main(psvm)'s that I want to be able to call when I do docker run ... -e on the image and pass an environment variable to specify the class path. Something like this: …
breezymri
  • 3,975
  • 8
  • 31
  • 65
3
votes
0 answers

The docker-maven-plugin and jacoco interferes with each other

We have projects where we use jacoco to aggregate code coverage over several modules. We also have some project that use the Fabric8 docker-maven-plugin to run black box test. But for the first time we would now like to run them both i the same…
Roland
  • 5,328
  • 10
  • 37
  • 55
3
votes
0 answers

Docker Maven Plugin version 1.4.13 build time takes too long

After updating dockerfile-maven-plugin version 1.4.10 to 1.4.13 the build times take almost 4 times slower than before. My maven configuration is the same for both cases. The git repo : sample pom file After the clone run the project via mvn clean…
i.karayel
  • 4,377
  • 2
  • 23
  • 27
3
votes
0 answers

Using fabric8 docker-maven-plugin to build images on a remote docker daemon

I'm attempting to use fabric8's docker-maven-plugin to build docker images within my gitlab ci pipeline. Background: My image build stage in gitlab-ci.yml looks like: build_image: stage: build image: $JAVA_IMAGE services: - name:…
Mike S
  • 1,451
  • 1
  • 16
  • 34
3
votes
1 answer

Build and Publish docker images to Nexus3

New to nexus.. We are trying to automate build process (Build docker images and publish them to Nexus3 repository).. My requirement is, I have an image built using docker build -t : . now I want to publish this docker image to…
rameshthoomu
  • 1,234
  • 2
  • 17
  • 33
3
votes
1 answer

Docker for Windows and docker-maven-plugin - "SSLException: Unrecognized SSL message, plaintext connection" error

I'm using Docker Desktop for Windows v1.13.0 and docker-maven-plugin v0.4.13 on my local Windows 10 Pro machine. I'm using mvn clean package docker:build to build my project and generate the docker image. The build fails: [INFO] …
2
votes
1 answer

How to restart Docker container before each test execution with Maven?

I would like to start a fresh postgres docker container before each single test execution, and NOT just once before running all integration tests. The configuration I currently have is like most Google results suggest:
2
votes
0 answers

Gitlab CI, how to get a container host name, started with docker-maven-plugin

I'm setting up an integration testing environment for my Spring Boot Java application. So I'm spinning off a PostgreSQL database using docker-maven-plugin, which my application is supposed to call into. This setup works ok when running mvn verify on…
Yonoss
  • 1,242
  • 5
  • 25
  • 41
2
votes
1 answer

Spring Boot 2 app cannot connect to mysql while run inside docker container triggered by docker-maven-plugin

The app connects just fine when run without docker using mvn spring-boot:run. When run using mvn docker:remove docker:stop clean package docker:build docker:start the following error is being thrown Error: [main] ERROR…
J.Olufsen
  • 13,415
  • 44
  • 120
  • 185
1
2 3 4 5