Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus based JVM mode image not running after docker-slim build #119

Open
muratkarakas opened this issue Dec 30, 2019 · 1 comment
Open

Comments

@muratkarakas
Copy link

Hi,

I've created simple java project with quarkus(https://quarkus.io/guides/getting-started). If I build image with quarkus native mode I can successfully build slim image but if I use jvm based image it fails to run after build-slim process

Steps:

1.Create project

mvn io.quarkus:quarkus-maven-plugin:1.1.0.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=getting-started \
    -DclassName="org.acme.quickstart.GreetingResource" \
    -Dpath="/hello"
cd getting-started
  1. Build java app
    ./mvnw package -DskipTests=true
  2. Build docker image(JVM based)
    docker build -f src/main/docker/Dockerfile.jvm -t quarkus/getting-started-jvm .
  3. docker-slim

docker-slim build --http-probe=false quarkus/getting-started-jvm
5. Run and got the error:
docker run quarkus/getting-started-jvm.slim "Error occurred during initialization of VM
Could not find agent library instrument on the library path, with error: Error loading shared library libinstrument.so: No such file or directory"

Is may be related with this issue #80 but not sure...

Note:

Dockerfile generated by quarkus

FROM fabric8/java-alpine-openjdk8-jre:1.6.5
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV AB_ENABLED=jmx_exporter

# Be prepared for running in OpenShift too
RUN adduser -G root --no-create-home --disabled-password 1001 \
  && chown -R 1001 /deployments \
  && chmod -R "g+rwX" /deployments \
  && chown -R 1001:root /deployments

COPY target/lib/* /deployments/lib/
COPY target/*-runner.jar /deployments/app.jar
EXPOSE 8080

# run with user 1001
USER 1001

ENTRYPOINT [ "/deployments/run-java.sh" ]

Thanks

@kcq
Copy link
Member

kcq commented Dec 31, 2019

@muratkarakas it might be related to how OpenJDK works on Alpine ( issue #80 also uses an Alpine-based image and it's likely related ). I'll try to repo the condition to make sure it's the case. Thank you for opening the issue!

The Dockerfile you shared looks similar to this one: https://github.com/quarkusio/quarkus-quickstarts/blob/master/getting-started/src/main/docker/Dockerfile.jvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants