Hello Team, How to set annotation during the docke...
# community-support
a
Hello Team, How to set annotation during the docker image build eg.
docker build --push --annotation "foo=bar" .
? we are using below command to build the image..
Copy code
./gradlew build docker -x test && docker tag ${{ steps.login-ecr.outputs.registry }}/${{ inputs.image-name }}:latest ${{ steps.login-ecr.outputs.registry }}/${{ inputs.image-name }}:${{ inputs.image-tag }}
This is our build.gradle
Copy code
docker {
    dependsOn build
    name "{registry-name}/${bootJar.baseName}"
    dockerfile file('src/main/docker/')
    files bootJar.archivePath
    buildArgs(['JAR_FILE': "${bootJar.archiveName}"])
    tags "${tag}"
}
Can someone please assist? Thanks..
v
Gradle does not have any built-in docker support and you did not even mention which of the various docker plugins you use. Probably just check the documentation of that plugin? Besides that, I strongly recommend switching to Kotlin DSL. By now it is the default DSL, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.