https://github.com/antonsjava/sb-splitter-plugin
https://github.com/antonsjava/sb-splitter-plugin
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/antonsjava/sb-splitter-plugin
- Owner: antonsjava
- License: apache-2.0
- Created: 2019-11-04T07:45:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-10-21T10:31:07.000Z (about 1 year ago)
- Last Synced: 2025-02-01T21:17:25.199Z (9 months ago)
- Language: Java
- Size: 62.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sb-splitter-plugin
The plugin to disassemble spring boot jar to help building layered docker image.
## Ideas
### Splitting SB jar
SB jar is splited to ./target/sb to folowing parts
- Dockerfile - dummy docker file used for creatinng layered image with another maven plugin
- app/classes - content of classes folder from SB jar
- app/libs - content of lib folder from SB jar which are not SNAPSHOTs
- app/snapshots - content of lib folder from SB jar which are SNAPSHOTs
- app/loader - loader classes from SB jar
- app/meta - meta files from SB jar
- app/cp.arg - classpath argument file for starting application
- app/start.sh - dummy start script (not used)
### Assemble files for docker build
You can use splited folder directly or you can reorganize them if you want using 'copy' elements.
It can be done by many plugins to simplify this I add possibility to configure set of pair
- from file - to file
- from directory content - to directory content
And the plugin copies specified files.
### Docker build
The plugin doesn't build docker image. You can use some other plugin or use maven exec plugin
to start layered build process. (see example)
It is resomanded to define own src/main/docker/Dockerfile which will replace genrated Dockerfile
## The plugin configuration
### Splitting
- property dockerFile define location of Dockerfile to be copied to target directory. Default value is "src/main/docker/Dockerfile"
- property sbFile define location of SB file to be split. Default value is "target/${project.build.finalName}.jar"
- property destDir define directory where sbFile will be unzipped. Default value is "target/sb/"
- property appFolder define subdirectory of destDir where layer folderf will be created "app/"
- property libsDir define subdirectory of appDir where layer will be created "libs/"
- property snapshotsDir define subdirectory of appDir where layer will be created "snapshots/"
- property loaderDir define subdirectory of appDir where layer will be created "loader/"
- property metaDir define subdirectory of appDir where layer will be created "meta/"
### Copying files
- property copies define set of pairs from/to. They define which files are copied and where. If from is file to must be file. If from is directory to is also directory.
(example: src/main/other-resources/assemblytarget/tmp/assembly)
## The plugin usage example
io.github.antonsjava
sb-splitter-plugin
LATESTVERSION
split
io.fabric8
docker-maven-plugin
docker.xit.camp
a.name.of/image:${project.version}