Gradle plugin to ease using and producing (multi-arch) OCI images without requiring external tools
APACHE-2.0 License
OciCopySpec
similar to org.gradle.api.file.CopySpec
OciExtension.copySpec()
and OciExtension.copySpec(Action<in OciCopySpec>)
factory methodsOciCopySpec.with(OciCopySpec)
OciLayerTask
:
digestAlgorithm
property of type OciDigestAlgorithm
with options SHA_256
(default) and SHA_512
compression
property of type OciLayerCompression
with options NONE
and GZIP
(default)mediaType
provider of type String
derived from compression
extension
property of type String
with convention derived from compression
digestFile
with digest
provider of type OciDigest
diffIdFile
with diffId
provider of type OciDigest
size
provider of type Long
org.gradle.api.artifacts.Configuration
that belongs to an image definition via OciImageDefinition.configuration
OciImageDefinition.Capabilities.add(Provider<String>)
containerd
normalizationoci/images/$imageDefName/$layerName
=> oci/images/$imageDefName
.diffId
and .digest
files with a single .properties
fileOciLayerTask.tarFile
to file
OciComponentTask.componentFile
to file
OciDigestAlgorithm.ociPrefix
to id
OciDigestAlgorithm.algorithmName
to standardName
main
is now added to the Gradle configuration and not only to the OCI componentPublished by SgtSilvio 7 months ago
ociImageDependencies
extension
ociImageDependencies.forTest(tasks.test) {
runtime(...)
}
Replaces the old syntax:
oci {
imageDependencies.forTest(tasks.test) {
add(...)
}
}
testing {
suites {
"test"(JvmTestSuite::class) {
ociImageDependencies {
runtime(...)
}
}
}
}
Published by SgtSilvio 8 months ago
.tag("tag1")
.tag(provider { "tag1" })
.tag("tag1", "tag2")
.tag(setOf("tag1", "tag2"))
.tag(provider { setOf("tag1", "tag2") })
.tag("tag1").tag("tag2", "tag3")
"."
is a placeholder for the default tag of the dependency, for example .tag(".", "latest")
keeps the tag and additionally adds a latest
tag (previously this was only possible by declaring the dependency twice, once without any call to tag
and secondly with .tag("latest")
)OciPushTask
:
--registry
: Pushes to the registry defined with the specified name in oci.registries
.--url
: Pushes to the specified registry URL.--credentials
: Authenticates to the registry using the credentials with the specified id.push{imageDefinitionName}OciImage
tasks of type OciPushSingleTask
for every image definition (task name is pushOciImage
for the main
image definition) with command line options:
--name
: Names the image. If not specified, the imageName defined in the image definition is used.--tag
: Tags the image. Option can be specified multiple times. The value .
translates to the imageTag defined in the image definition. If not specified, the imageTag defined in the image definition is used.OciRegistry.optionalCredentials()
OciImagesDependencies
(similar to Gradle's strongly-typed dependencies block)
constraint(DependencyConstraint)
âadd(DependencyConstraint)
constraint(CharSequence)
âadd(constraint(CharSequence))
constraint(Project)
âadd(constraint(Project))
constraint(Provider<MinimalExternalModuleDependency>)
âadd(constraint(Provider<MinimalExternalModuleDependency>))
constraint(ProviderConvertible<MinimalExternalModuleDependency>)
âadd(constraint(ProviderConvertible<MinimalExternalModuleDependency>))
add(DependencyConstraint)
add(DependencyConstraint, Action<in DependencyConstraint>)
add(Provider<out DependencyConstraint>)
add(Provider<out DependencyConstraint>, Action<in DependencyConstraint>)
constraint(CharSequence)
constraint(Project)
constraint(Provider<out MinimalExternalModuleDependency>)
constraint(ProviderConvertible<out MinimalExternalModuleDependency>)
java.time.Instant
could not be serialized)Published by SgtSilvio 8 months ago
.tag("tag1")
.tag(provider { "tag1" })
.tag("tag1", "tag2")
.tag(setOf("tag1", "tag2"))
.tag(provider { setOf("tag1", "tag2") })
.tag("tag1").tag("tag2", "tag3")
"."
is a placeholder for the default tag of the dependency, for example .tag(".", "latest")
keeps the tag and additionally adds a latest
tag (previously this was only possible by declaring the dependency twice, once without any call to tag
and secondly with .tag("latest")
)OciPushTask
:
--registry
: Pushes to the registry defined with the specified name in oci.registries
.--url
: Pushes to the specified registry URL.--credentials
: Authenticates to the registry using the credentials with the specified id.push{imageDefinitionName}OciImage
tasks of type OciPushSingleTask
for every image definition (task name is pushOciImage
for the main
image definition) with command line options:
--name
: Names the image. If not specified, the imageName defined in the image definition is used.--tag
: Tags the image. Option can be specified multiple times. The value .
translates to the imageTag defined in the image definition. If not specified, the imageTag defined in the image definition is used.OciRegistry.optionalCredentials()
OciImagesDependencies
(similar to Gradle's strongly-typed dependencies block)
constraint(DependencyConstraint)
âadd(DependencyConstraint)
constraint(CharSequence)
âadd(constraint(CharSequence))
constraint(Project)
âadd(constraint(Project))
constraint(Provider<MinimalExternalModuleDependency>)
âadd(constraint(Provider<MinimalExternalModuleDependency>))
constraint(ProviderConvertible<MinimalExternalModuleDependency>)
âadd(constraint(ProviderConvertible<MinimalExternalModuleDependency>))
add(DependencyConstraint)
add(DependencyConstraint, Action<in DependencyConstraint>)
add(Provider<out DependencyConstraint>)
add(Provider<out DependencyConstraint>, Action<in DependencyConstraint>)
constraint(CharSequence)
constraint(Project)
constraint(Provider<out MinimalExternalModuleDependency>)
constraint(ProviderConvertible<out MinimalExternalModuleDependency>)
java.time.Instant
could not be serialized)Published by SgtSilvio 9 months ago
OciRegistryDataTask
only stores necessary layers (previously unnecessary layers could be stored when a parent image has more architectures then the final image)Published by SgtSilvio 10 months ago
OciComponent
and OciLayer
) when publishing OCI image variantsclassifier
property to OciLayer
and OciComponentTask
destinationDirectory
property to OciComponentTask
outputDirectory
property to destinationDirectory
in OciLayerTask
tar.gz
to tgz
Published by SgtSilvio 10 months ago
Published by SgtSilvio 10 months ago
OciRegistry.credentials()
that automatically uses the registry name as the credentials identityOciRegistry.url
by default
https\://registry-1.docker.io=<my-docker-hub-mirror>
in ~/.gradle.properties
OciRegistry.finalUrl
that exposes the mapped url
add("library:eclipse-temurin:sha256!56be7e97bc4d2fffafdda7e8198741fd96513bc12f05d6da9f18c2577a1d5649")
afterEvaluate
-
in digests (theoretically allowed to be used, although not currently)Published by SgtSilvio 11 months ago
oci.imageDependencies
add("library:eclipse-temurin:20.0.1_9-jre-jammy", tag("library:eclipse-temurin:20"))
add("library:eclipse-temurin:20.0.1_9-jre-jammy").tag("20")
add("library:eclipse-temurin:20.0.1_9-jre-jammy", tag("eclipse-temurin:20"))
add("library:eclipse-temurin:20.0.1_9-jre-jammy").name("eclipse-temurin").tag("20")
OciTagComponentTask
) requiredOciImageDependenciesContainer
oci.imageDependencies.register("images") { default("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.register("images") { add("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.register("images") { scope("v2")("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.register("imagesV2") { add("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.forTest(tasks.test) { default("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.forTest(tasks.test) { add("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.forTest(tasks.test) { scope("v2")("library:eclipse-temurin:20.0.1_9-jre-jammy") }
oci.imageDependencies.forTest(tasks.test, "v2") { add("library:eclipse-temurin:20.0.1_9-jre-jammy") }
OciPushTask.Registry
OciPushTask.registryUrl
to OciPushTask.registry.url
OciPushTask.credentials
to OciPushTask.registry.credentials
OciPushTask.registry { }
OciPushTask.registry.from(OciRegistry)
Published by SgtSilvio 12 months ago
OciImageDefinition.imageReference
into imageName
and imageTag
ProjectDependencyPublicationResolver.resolve
internal api)oci/registry
to oci/registries
Published by SgtSilvio about 1 year ago