gematik / ref-idp-server

Der Gematik IDP-Server dient zur Identifizierung von Versicherten und Leistungserbringenden Organisationen.
Apache License 2.0
22 stars 5 forks source link

Issue with building Dockerimage #3

Closed CWeykopf closed 1 year ago

CWeykopf commented 2 years ago

[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.34.1:build (default) on project idp-server: Configured Dockerfile "/Users/chris/Entwicklung/DEOS/E-Rezept/ref-idp-server/idp-server/target/tmpdocker/Dockerfile" (resolved to "/Users/chris/Entwicklung/DEOS/E-Rezept/ref-idp-server/idp-server/target/tmpdocker/Dockerfile") doesn't exist -> [Help 1]

macOS 11.6 openjdk 11.0.2 Apache Maven 3.8.2 Docker version 20.10.8, build 3967b7d

Any hints?

Arkinator commented 2 years ago

hmm, works on my machine :D what goals did you execute? (I actually use pretty much the same setup, the only difference being java 12, but that sounds rather unlikely)

CWeykopf commented 2 years ago

First to say, I have no experience with Java nor Maven.

I retried to build with Java 13.0.1 without success. To build I followed the instructions in the Readme. man clean compile rund successful. mvn install fails with the Docker error. The tests run without error. Also mvn test runs fine.

docker-compose build --build-arg mode=tested fails also but with an other error. Building idpserver [+] Building 0.0s (1/2)
=> [internal] load build definition from Dockerfile => => transferring dockerfile: 2B failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount998915947/Dockerfile: no such file or directory ERROR: Service 'idpserver' failed to build : Build failed

There is no /var/lib/docker directory. The Docker runs fine with other images.

Kgessner commented 2 years ago

I'm very much surprised that Arkinator has a working docker compose part on his machine (linux?) there are necessary files missing on github like idp-server/buildDockerImage.sh idp-server/deleteDockerImage.sh idp-server/Dockerfile at least the dockerfile would be useful ;-)

DaMo86 commented 2 years ago

I see the same errors, the files are just missing in the repo - can you maybe add the Dockerfile @Arkinator? According to the idp-server/pom.xml -> maven-resource-plugin they should be located in ${basedir}/src/main/docker.

Arkinator commented 2 years ago

The file was stripped during the release to github due to internal information being present. I'm sorry about that. I'm no longer with the team but I'll adress the issue.

The dockerfile itself is really nothing special, the following might be a good starting point:

FROM adoptopenjdk/maven-openjdk11:latest
RUN mkdir /app
COPY /target/idp-server*.jar /app/idp-server.jar
WORKDIR /app
HEALTHCHECK CMD curl --fail http://localhost:8080/actuator/health | grep UP || exit 1
CMD ["java", "-jar", "idp-server.jar"]
DaMo86 commented 2 years ago

Thank you for the fast reply!

I was able to build the system with a slight change (the .jar is already copied to the tmpDocker folder, so no target necessary): COPY ./idp-server*.jar /app/idp-server.jar

I created 4 similiar Dockerfiles, which copying the corresponding artifact (e.g. idp-sektoral.jar, idp-server.jar, ...): grafik

DaMo86 commented 2 years ago

I also found the overall problem: looks like everything about Docker is ignored in .gitignore

RStaeber commented 1 year ago

There is an image available on docker hub as well: https://hub.docker.com/r/gematik1/idp-server/