taplo icon indicating copy to clipboard operation
taplo copied to clipboard

No shell in container for 0.10.0 (breaks Gitlab CI)

Open harmathy opened this issue 7 months ago • 9 comments

I use taplo as part of a CI pipeline which requires a shell to be available in the container. Since release 0.10.0 there is no container image which includes a shell anymore.

Could you have a variant which includes a shell?

harmathy avatar May 23 '25 15:05 harmathy

Could you have a variant which includes a shell?

No, taplo is usable without any dependencies and that way image provides only the binary itself. CI doesn't require shell, your pipeline configuration removes entrypoint which probably breaks it.

panekj avatar May 23 '25 21:05 panekj

Could you have a variant which includes a shell?

No, taplo is usable without any dependencies and that way image provides only the binary itself. CI doesn't require shell, your pipeline configuration removes entrypoint which probably breaks it.

@panekj No, Gitlab CI requires a shell. See Image Requirements! Also, removing the entry point is necessary in this case, since all commands will be passed to that shell.

harmathy avatar May 26 '25 07:05 harmathy

also having this issue. the lack of sh in the image is a real problem for gitlab ci. as a workaround, ig you could install taplo in the ci jobs via package manager instead of using the official image, but it's not great, so i'll probably downgrade to an older image version for the moment, ie 0.9.3

ShaddyDC avatar May 26 '25 08:05 ShaddyDC

For anyone having the same problem, here is what I use as way to fix this:

FROM docker.io/tamasfe/taplo:0.10.0 as tablo_binary

FROM alpine
RUN apk add bash

COPY --from=tablo_binary /taplo /usr/local/bin/taplo

harmathy avatar May 26 '25 08:05 harmathy

Maybe document about the workaround provided by @harmathy would be good enough.

JounQin avatar May 26 '25 08:05 JounQin

i mean that works, but it still requires that you build the image yourself somewhere and store it in some container registry, as well as keep it up to date. like, it's not exactly complicated, but it does introduce a lot of friction

if this project prefers to keep the image maximally minimal though, i'm happy to provide provide that though.

ShaddyDC avatar May 26 '25 08:05 ShaddyDC

If other platforms work except GitLab CI fails, I think we should not change anything here.

JounQin avatar May 26 '25 08:05 JounQin

fair! if you don't care about version tags and just want the latest version (or pin to a specific digest), i've created an image you can use here: ghcr.io/shaddydc/taplo.

it's very minimal and will automatically be kept up to date with renovate:

FROM alpine:3.21.3@sha256:a8560b36e8b8210634f77d9f7f9efd7ffa463e380b75e2e74aff4511df3ef88c

COPY --from=docker.io/tamasfe/taplo:0.10.0@sha256:e0e247250609d2c0f3a77bc8003dc21eaa16ffd1b07ef4bad16c35f6845eec2b /taplo /usr/local/bin/taplo

alternatively, if you don't want some random's image, you can use nixery: nixery.dev/shell/taplo.

that will likely work, though they caution about using their images in prod, and the image size will be 159 mb to my 21mb and the official image's 13mb.

ShaddyDC avatar May 26 '25 09:05 ShaddyDC

This problem is also breaking woodpecker-CI builds.

dessalines avatar Jun 07 '25 01:06 dessalines

This is still very much an issue.

dessalines avatar Dec 01 '25 21:12 dessalines