slimtoolkit / slimtoolkit/slim
Quarkus based JVM mode image not running after docker-slim build
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 23.4k
- Forks
- 840
- PR merge metrics
- No merged PRs in 30d
Description
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
- Build java app
./mvnw package -DskipTests=true - Build docker image(JVM based)
docker build -f src/main/docker/Dockerfile.jvm -t quarkus/getting-started-jvm . - 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 https://github.com/docker-slim/docker-slim/issues/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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Dockerfile.jvm generated by Quarkus and reproduce the reported docker-slim build command using the fabric8 Java image. Run the resulting .slim image and compare its initialization failure with the original image; done means the JVM image starts without the missing libinstrument.so error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100