sbt / docker-sbt

Official sbt docker images
Apache License 2.0
320 stars 235 forks source link

Support for Pushing to Alternative Registries (Amazon ECR Public Gallery, GitHub Registry) #285

Closed kijuky closed 4 months ago

kijuky commented 4 months ago

Hello,

First, thank you for the excellent work on this project. The SBT Docker image has been incredibly useful for our development process.

I am writing to inquire about the possibility of supporting image pushes to container registries other than Docker Hub, specifically Amazon ECR Public Gallery and GitHub Registry.

Reason for Request:

Docker Hub has rate limits that can hinder our CI/CD workflows. To ensure smoother and more reliable operations, we would like to have the option to push images to alternative registries such as Amazon ECR Public Gallery and GitHub Registry. These registries do not have the same rate limiting issues and would provide us with more flexibility.

Suggested Changes:

  1. Add configuration options to the SBT Docker plugin for specifying alternative registries.
  2. Provide documentation on how to authenticate and push images to these alternative registries.

We believe this feature would benefit many users who face similar issues with Docker Hub's rate limits. Thank you for considering this request, and please let us know if there's any way we can assist in implementing this feature.

francisdb commented 4 months ago

I think you created this on the wrong repository and you might be looking for https://www.scala-sbt.org/sbt-native-packager/formats/docker.html#publishing-settings (or https://github.com/marcuslonnberg/sbt-docker)?

Feel free to re-open if I misunderstood you.

kijuky commented 4 months ago

My goal that:

use amazon public ecr:

FROM public.ecr.aws/sbtscala/scala-sbt:<<VERSION>>

or use ghcr

FROM ghcr.io/sbtscala/scala-sbt/:<<VERSION>>

To do that, I think it is necessary to push the file below to a repository other than docker hub.

https://github.com/sbt/docker-sbt/blob/master/.github/workflows/build.yml

francisdb commented 4 months ago

Docker Hub has rate limits that can hinder our CI/CD workflows.

Is the problem not that you are not caching properly on your CD/CI?

Images should already be available at the google cloud cache https://cloud.google.com/artifact-registry/docs/pull-cached-dockerhub-images

I personally prefer to have a single source of truth at docker hub and not have to publish to multiple places.

kijuky commented 4 months ago

@francisdb

kijuky commented 4 months ago

Thank you for your kindness. it was very helpful. I will review my settings.

Thank you for the information on mirror repositories as well.