[英]How to use instruction property in springbootapplication extension with bmuschko/gradle-docker-plugin?
https://bmuschko.github.io/gradle-docker-plugin/ https://bmuschko.github.io/gradle-docker-plugin/
I am trying to use HEALTHCHECK inside build.gradle using the above gradle-docker-plugin for a spring-boot app as following.我正在尝试使用上面的 gradle-docker-plugin 在 build.gradle 内使用 HEALTHCHECK 用于 spring-boot 应用程序,如下所示。
docker {
springBootApplication {
baseImage = 'docker.infy.com:4443/containers/openjdk-11jre:latest'
maintainer = "astra-aws-dev@infy.com, ic-pe@infy.com"
ports = [8080]
images = ["infy/${project.name}:latest"]
jvmArgs = ['-server', '-Dathenz.zpe.policy_dir=/var/zpe', 'Dathenz.athenz_conf=/etc/athenz/athenz.conf']
instruction = 'HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:8080/actuator/health || exit 1'
}
}
I am referring to the plugin-user-guide at 2.5.2 of https://bmuschko.github.io/gradle-docker-plugin/current/user-guide/ to configure the healthcheck of the container.我指的是 plugin-user-guide at 2.5.2 of https://bmuschko.github.io/gradle-docker-plugin/current/user-guide/配置容器的健康检查。 But for springbootapplication extension, it throws an error saying "instruction" is an unknown property.
但是对于 springbootapplication 扩展,它会抛出一个错误,说“instruction”是一个未知的属性。 Please help me resolve this.
请帮我解决这个问题。 Thanks in advance.
提前致谢。
The extension does not expose a property named instruction
, as shown in the documentation .该扩展没有公开名为
instruction
的属性,如文档中所示。 You can modify the instructions of the task named createDockerfile
though.不过,您可以修改名为
createDockerfile
的任务的说明。 The following adds the instruction to the existing list of instructions created by the plugin.下面将指令添加到插件创建的现有指令列表中。 See the Groovydocs of the task for more information.
有关更多信息,请参阅任务的 Groovydocs 。
createDockerfile.instruction('HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:8080/actuator/health || exit 1')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.