简体   繁体   中英

Jenkins plugin for docker

I want Jenkins to build JAVA project and then wrap it to the container and send it to the Docker Registry . Is there any plugin for wrapping jars or files to container?

The closest plugin would be the CloudBees Docker Custom Build Environment Plugin which executes a job in the container of your choice, but it includes your sources as a volume for that execution.

That means if you were to commit the container (as a new image) and push it to the docker registry, it would not only include the jars, but also your sources, and all intermediate build files, which you might not want.

It is easier to add a step to your regular job which would docker build from a Dockerfile (based on a jdk base image ).
That Dockerfile would COPY the jars built from the previous steps of the same job. That same last step would publish the image to the registry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM