question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TailwindCSS Standalone CLI not working in Alpine Linux (docker)

See original GitHub issue

The tailwindcss binary release is not working on Alpine Linux.
Tested with the release tailwindcss-linux-x64 v3.0.7 on the latest docker alpine image.

If I run an alpine container (installing curl, and downloading the standalone release as described here https://tailwindcss.com/blog/standalone-cli#get-started ) I got nothing (binary not found). Running the exact same steps in debian works.

Tell me if I need to provide more information.

Example steps to reproduce it:

#On the host
docker run -it --rm alpine ash

#Within the container
apk add curl
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64
chmod +x tailwindcss-linux-x64
mv tailwindcss-linux-x64 tailwindcss
./tailwindcss init
# Got => ./tailwindcss: not found

The exact same steps works fine using debian for example:

#On the host
docker run -it --rm debian bash

#Within the container
apt update
apt install curl # Type Y to install
curl -sLO https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-x64
chmod +x tailwindcss-linux-x64
mv tailwindcss-linux-x64 tailwindcss
./tailwindcss init
# Generate tailwind.config.js

Edit: Here is the output of file:

tailwindcss: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=2e882d60273a4031f72a88815a36cb574dc1090b, for GNU/Linux 2.6.32, stripped

Seems I need to install some libraries…

Edit 2: This answer from SO seems relevant to the issue: https://stackoverflow.com/a/66974607

Executables built on glibc distributions depend on /lib/x86_64-linux-gnu/libc.so.6, for example, which is not available on Alpine (unless, they are statically linked).

So is it possible to statically link dependencies when compiling the binaries?

Edit 3: Some workarounds are based on installing gcompat and/or libc6-compat, but those do not fix the tailwindcss issue.

Edit 4: I just noticed that the standalone CLI is using a tool called pkg under the hood.

So maybe this issue does not belong here… If so, feel free to close.

Edit 5: As stated below, installing both gcompat and build-base solves the problem.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mveytsmancommented, Dec 29, 2021

I added a suggestion to switch to static builds here: https://github.com/tailwindlabs/tailwindcss/discussions/6785

0reactions
altdsoycommented, Dec 28, 2021

@DistantMe, Indeed, as also stated by @mveytsman, for me gcompat and build-base solves the problem too!

I tried many different libraries (but rather in a random way)… I should have tried in a better way those two one together… Anyway, thank you very much for your inputs… Closing the issue…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Standalone CLI: Use Tailwind CSS without Node.js
Today we're announcing a new standalone CLI build that gives you the full power of Tailwind CLI in a self-contained executable — no...
Read more >
Top Docker and Docker Desktop alternatives - LogRocket Blog
Explore the top alternatives to Docker and Docker Desktop for building, running, and distributing container images, like Podman and Lima.
Read more >
Tailwind in prod - sh: 1: tailwindcss: not found - Elixir Forum
Hello,. After I successfully figured out how to set up my Dockerfile to support Rust (for package Explorer) I run into an error...
Read more >
Docker - Create T3 App
In this demo we are using two variables, pay attention to their positions in the Dockerfile , command-line arguments, and docker-compose.yml :.
Read more >
Reducing Docker's image size while creating an offline ...
The first step is to get any kind of Docker image working, straight to ... We define yarn start as start command when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found