Skip to content
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

[Distroless] Publish Python distroless variants #32914

Open
Tracked by #32817
damondouglas opened this issue Oct 23, 2024 · 1 comment
Open
Tracked by #32817

[Distroless] Publish Python distroless variants #32914

damondouglas opened this issue Oct 23, 2024 · 1 comment

Comments

@damondouglas
Copy link
Contributor

damondouglas commented Oct 23, 2024

This tasks focuses on publishing Python distroless variants. The following is a possible implementation.

The task :sdks:python:container:pushAll configured in sdks/python/container/build.gradle iterates through python versions, invoking :sdks:python:container:push<version>. Through various additional Gradle tasks, these ultimately converge to the :sdks:python:container:py<version>:docker tasks. Said :docker task uses a pushContainer flag to indicate whether to publish the resulting container image. A likely non-obtrusive way to publish distroless variants may be to refactor sdks/python/container/build.gradle from:

tasks.register("pushAll") {
  for(int ver=min_python_version; ver<=max_python_version; ++ver) {
      dependsOn ':sdks:python:container:push3' + ver
  }
}

to:


var min_distroless_version = <something>

tasks.register("pushAll") {
  for(int ver=min_python_version; ver<=max_python_version; ++ver) {
      dependsOn ':sdks:python:container:push3' + ver
  }
  
  // set the Gradle property for building distroless
  project.setProperty('docker-distroless', 'true')
  for(int ver=min_distroless_version; ver<=max_python_version; ++ver) {
      dependsOn ':sdks:python:container:push3' + ver
  }
}
@damondouglas
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant