slimtoolkit / slimtoolkit/slim

JVM libzip.so file lost

Open
#80 4 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug triage WIP
Dominant language
Go
Stars
23.4k
Forks
840
PR merge metrics
No merged PRs in 30d

Description

Thanks for this tool.

When I want to try docker-slim, I have a problem, I want to confirm if there is a problem with my usage, or is this a bug.

My Dockerfile is here

FROM maven:3.6.1-jdk-8-alpine AS builder

WORKDIR /app

COPY pom.xml /app/
RUN mvn dependency:go-offline
COPY src /app/src
RUN mvn -e -B package

FROM builder AS dev

RUN apk add --no-cache vim

FROM openjdk:8-jre-alpine

COPY --from=builder /app/target/gs-spring-boot-0.1.0.jar /

CMD [ "java", "-jar", "/gs-spring-boot-0.1.0.jar" ]

you can find it on https://github.com/tao12345666333/spring-boot-hello-world/blob/master/Dockerfile

(MoeLove) ➜  ~ sudo docker-slim  build  --http-probe local/spring-boot:1
[sudo] tao 的密码:
docker-slim[build]: state=started   
docker-slim[build]: info=params target=local/spring-boot:1 continue.mode=enter
docker-slim[build]: state=inspecting.image
docker-slim[build]: info=image id=sha256:01e4898d1141763400d39111609425ba6232b8bf42f46a6033fdb2b7306dc75b size.bytes=103166686 size.human=103 MB
docker-slim[build]: info=image.layers index=0 name='local/spring-boot' tags='1'                 
docker-slim[build]: state=inspecting.container                                                                                                                                                                      
docker-slim[build]: info=container status=created id=32b94537fe4fb4b68b0278384f7857d2a2a87b1bbf76dfb63dd3c98ac047ea58
docker-slim[build]: info=cmd.startmonitor status=sent                         
docker-slim[build]: info=event.startmonitor.done status=received     
docker-slim[build]: info=container name=dockerslimk_17626_20190530031807 id=32b94537fe4fb4b68b0278384f7857d2a2a87b1bbf76dfb63dd3c98ac047ea58 target.port.list=[] target.port.info=[]
docker-slim[build]: info=prompt message='press <enter> when you are done using the container'
                              
docker-slim[build]: state=processing
docker-slim[build]: state=building message='building minified image'
docker-slim[build]: state=completed       
docker-slim[build]: info=results status='MINIFIED BY 3.48X [103166686 (103 MB) => 29652590 (30 MB)]'
docker-slim[build]: info=results  image.name=local/spring-boot.slim image.size='30 MB' data=true
docker-slim[build]: info=results  artifacts.location='/usr/local/bin/.docker-slim-state/images/01e4898d1141763400d39111609425ba6232b8bf42f46a6033fdb2b7306dc75b/artifacts'
docker-slim[build]: info=results  artifacts.report=creport.json
docker-slim[build]: info=results  artifacts.dockerfile.original=Dockerfile.fat
docker-slim[build]: info=results  artifacts.dockerfile.new=Dockerfile
docker-slim[build]: info=results  artifacts.seccomp=local-spring-boot-seccomp.json
docker-slim[build]: info=results  artifacts.apparmor=local-spring-boot-apparmor-profile
docker-slim[build]: state=done
(MoeLove) ➜  ~ docker run --rm local/spring-boot.slim
Error occurred during initialization of VM
Unable to load ZIP library: /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/libzip.so
(MoeLove) ➜  ~ docker tag local/spring-boot:1 taobeier/spring-boot-hello-world:1
(MoeLove) ➜  ~ docker push taobeier/spring-boot-hello-world:1

the docker image I have beed pushed to DockerHub taobeier/spring-boot-hello-world:1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the report with the supplied Dockerfile, the local/spring-boot:1 image, and docker-slim build --http-probe. Compare the original and slim images, focusing on the missing /usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/libzip.so; done means the slim image starts the Java application without the reported VM initialization error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.