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

Scalafmt Dockerhub has stopped updating #4761

Closed
henricook opened this issue Jan 29, 2025 · 11 comments · Fixed by #4762
Closed

Scalafmt Dockerhub has stopped updating #4761

henricook opened this issue Jan 29, 2025 · 11 comments · Fixed by #4762

Comments

@henricook
Copy link

Requirement

I was hoping to pull the latest version of Scalafmt, 3.8.6, to run in a docker container

Issue

I notice that public images have not been updated on Dockerhub since 3.8.4-RC4 https://hub.docker.com/r/scalameta/scalafmt/tags

Question

Would it be possible to push the latest images please? :-)

cc @olafurpg as you seem to publish images most regularly

Thanks everyone

@henricook
Copy link
Author

Thank you @kitbellew

@henricook
Copy link
Author

@kitbellew Sorry, I don't suppose you could trigger it retrospectively for 3.8.6?

@kitbellew
Copy link
Collaborator

@kitbellew Sorry, I don't suppose you could trigger it retrospectively for 3.8.6?

Certainly!

How?

@henricook
Copy link
Author

Haha @kitbellew - fair point. I'd be happy to build one by hand and provide it for you to push with the docker creds? But look I don't want to waste your time. If the resolution is that docker images aren't present for the last couple of releases and that they'll be present again from the next release I'm very happy to wait for that.

@henricook
Copy link
Author

Unfortunately this also didn't succeed with 3.9.0 but I don't have permission to reopen this issue

@henricook
Copy link
Author

3.9.1 and 3.9.2 wrote images but unfortunately both are faulty

docker run -it scalameta/scalafmt:3.9.2 bash
Unable to find image 'scalameta/scalafmt:3.9.2' locally
3.9.2: Pulling from scalameta/scalafmt
f18232174bc9: Already exists 
9a2b35279846: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:0d40b19d5730c4a8e0daa08254e7c2d447ac0a1f61a1108e60c2b64113a99a02
Status: Downloaded newer image for scalameta/scalafmt:3.9.2
exec /bin/scalafmt: no such file or directory

@kitbellew
Copy link
Collaborator

3.9.1 and 3.9.2 wrote images but unfortunately both are faulty

docker run -it scalameta/scalafmt:3.9.2 bash
Unable to find image 'scalameta/scalafmt:3.9.2' locally
3.9.2: Pulling from scalameta/scalafmt
f18232174bc9: Already exists 
9a2b35279846: Pull complete 
4f4fb700ef54: Pull complete 
Digest: sha256:0d40b19d5730c4a8e0daa08254e7c2d447ac0a1f61a1108e60c2b64113a99a02
Status: Downloaded newer image for scalameta/scalafmt:3.9.2
exec /bin/scalafmt: no such file or directory

I see two options:

  • someone who understands how this works (or who implemented this in the first place) comes to the rescue
  • we deprecate dockerhub integration

For the reference, here's the build that published this image,
and from the Build and push section log, it appears to create /bin/scalafmt without an issue.

@tgodzik what do you think?

@tgodzik
Copy link
Contributor

tgodzik commented Mar 3, 2025

If there is binaries available building a docker image separately should be trivial. We just need one curl invocation and extract it. Do we really need the docker image built here?

@henricook
Copy link
Author

henricook commented Mar 3, 2025

If sharing my use case helps, I fetch the docker image in a CI/CD pipeline to run scalafmt against my code as a dedicated job. I guess a benefit of docker Vs. curling a binary directly is that I benefit from docker's cache, so I don't have to refetch the same version of scalafmt many times from the internet.

Edit: But I imagine people could employ CI/CD file caches if it's available to them to similar effect?

@kitbellew
Copy link
Collaborator

If sharing my use case helps, I fetch the docker image in a CI/CD pipeline to run scalafmt against my code as a dedicated job. I guess a benefit of docker Vs. curling a binary directly is that I benefit from docker's cache, so I don't have to refetch the same version of scalafmt many times from the internet.

Edit: But I imagine people could employ CI/CD file caches if it's available to them to similar effect?

so you're using docker as a package manager. and if you're using docker, i doubt you're speed-sensitive and require a native image. i am assuming your pipeline does something other than just formatting (also, why do you need formatting in a CI/CD pipeline as opposed to a formatting check?). perhaps it uses sbt, in which case you could simply use sbt-scalafmt plugin (and take advantage of any ivy caching).

my point is simple: i do not know how this docker image is broken, i can't examine it, and with the wide adoption of integrations like sbt and scala-cli, this integration emerges as straight-up tech debt...

@henricook
Copy link
Author

I could swallow that, especially if no one else is making any noise about it!

Ultimately I agree with you, the way we're doing it in our pipelines (it's a check job in the pipeline so that PRs with poor formatting can't be merged) can probably be replaced by some other form of caching the downloaded scalafmt version.

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

Successfully merging a pull request may close this issue.

3 participants