-
Notifications
You must be signed in to change notification settings - Fork 88
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
#250: Jib maven plugin added to make the containerization easier. #317
Closed
+136
−14
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
8e2985b
google jib added to create image using maven
f4e58ea
google jib added to create image using maven
d5b4e72
variables added for the base image and version. prepared user guide.
31e226a
version upgraded
sujith-mn f3d28b1
fixing the format
sujith-mn 4ca1a2a
formatted
sujith-mn 9ea62b1
version upgraded
sujith-mn d03ff89
formatted, added to batch
sujith-mn 0f7f5a4
Updated guide
sujith-mn fad6f19
Update guide-jib.asciidoc
sujith-mn 11fff2c
Update guide-jib.asciidoc
sujith-mn 52e7f61
Update guide-jib.asciidoc
sujith-mn a3e5c6c
Update guide-jib.asciidoc
hohwille bed4bf2
fixed indendation
hohwille 6c7dcd3
version upgraded
sujith-mn 7c81de5
Update pom.xml
hohwille 0327cc6
Merge branch 'master' into dev_jib
hohwille 4be5ac6
Merge branch 'master' into dev_jib
hohwille 8f561ae
Merge branch 'master' into dev_jib
maybeec 912d38e
Merge branch 'master' into dev_jib
maybeec 4eb6da0
Merge branch 'master' into dev_jib
maybeec 3cca1de
Merge branch 'master' into dev_jib
maybeec 07c5767
Merge remote-tracking branch 'upstream/master' into dev_jib
d1eaad4
updated pom
e1ef0fb
Merge branch 'dev_jib' of https://github.com/sujith-mn/devon4j into d…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
:toc: | ||
toc::[] | ||
|
||
= JIB | ||
jib is a tool from Google to create Docker images in simple and faster way. No dockerfile or no docker compose file is required. Using Jib, image can be created and uploaded to the registery even without Docker daemon. | ||
|
||
The JIB maven plugin configured to build the image using mvn command. | ||
|
||
== Build and run the image locally | ||
The Docker daemon should be available locally. | ||
|
||
To build the docker image. | ||
[source] | ||
---- | ||
mvn compile -Pcontainer | ||
|
||
docker images | ||
|
||
REPOSITORY TAG IMAGE ID CREATED SIZE | ||
myapp-server/java 0.0.1-SNAPSHOT c521c9800c48 51 years ago 206MB | ||
myapp-api/java 0.0.1-SNAPSHOT 7004670aa31e 51 years ago 161MB | ||
myapp-core/java 0.0.1-SNAPSHOT 82d949c3daa3 51 years ago 205MB | ||
---- | ||
|
||
To run the image. | ||
|
||
[source] | ||
---- | ||
docker run --publish 8081:8081 <image> | ||
---- | ||
|
||
== Upload the image to the registery | ||
|
||
No docker daemon required to be installed on your machine for this. | ||
|
||
The first step is to configure the registery details in .m2/settings.xml. | ||
|
||
[source] | ||
---- | ||
<servers> | ||
<server> | ||
<id>«registery»</id> | ||
<username>«username»</username> | ||
<password>«password»</password> | ||
</server> | ||
</servers> | ||
---- | ||
Keep the password encrypted (`mvn -ep`). Refer the documentation for the password encryption | ||
https://maven.apache.org/guides/mini/guide-encryption.html | ||
|
||
Run the below command to create and push the image to the image repository. | ||
[source] | ||
---- | ||
mvn compile -P release,container | ||
|
||
---- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,5 +51,4 @@ | |
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what I wrote in my review comment. It is not so good to add it to then parent pom and then having the need to disable (skip) it in all other modules. Please therefore move the plugin only to the
server
module that provides the deliverable of the entire app by design.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JIB plugin configured in server/pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively tried different way to build: