Custom command aliases #213
Replies: 1 comment 1 reply
-
Hi @jdwillmsen Thanks for using the plugin, and happy to now it's useful to you. Don't hesitate to show your appreciation by giving us a ⭐ on Github :-)
Humm... was the project generated with Java 21 from the beginning? if not, you might want to change the config (in java {
sourceCompatibility = '21'
} Now, regarding your question, you can totally define and use you very own tool to build the docker image. {
// ...
"targets": {
//...
"build-image-jib": {
"executor": "nx:run-commands",
"options": {
"command": "./gradlew jib" // exact command depends on how jib is configured in the project, but you get the idea
}
}
}
} Note: the nx:run-commands is a generic helper executor from Nx, that you can use to run any command available on your projet or globally, in the system. Than, you can simply run the task like usual : Some pointers to configure jib : https://medium.com/@ujjawalr/build-docker-images-with-gradle-jib-plugin-6ce29543beb5 |
Beta Was this translation helpful? Give feedback.
-
Hi team,
I have recently started using this plugin and so far it has been great!
Although I did have a few minor hiccups with the docker image builder. It appears to error out for me by default. As I am trying to run gradle 8.6 with Java v21 and when it tries to run the underlying build with @nxrocks/nx-spring-boot:build-image executor it errors out as I believe it tries to use the JVM runtime of 17.
Hence I looked through the source code, which was quite through and impressive and saw how it was implemented so that I could pull it out and create my own executor. As I was going to use the jib plugin as I am more familiar with it and it has a few benefits for running in CI versus other image creators.
This however brings me to the question if it would be valuable or feasible to allow users of these executors to provide their own command aliases. I can see this as potentially beneficial as their already is a great underlying infrastructure that just need a few more options to hook into either gradle/maven environment.
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions