tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
83.52k stars 4.23k forks source link

Illegal instruction when using beta inside Docker #15181

Open npezza93 opened 4 days ago

npezza93 commented 4 days ago

What version of Tailwind CSS are you using?

v4 beta 2

What build tool (or framework if it abstracts the build tool) are you using?

docker and ruby

What version of Node.js are you using?

🤷

What browser are you using?

For example: N/A

What operating system are you using?

linux

Reproduction URL

Dockerfile

# syntax=docker/dockerfile:1
# check=error=true

ARG RUBY_VERSION=3.4.0-preview2
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base

RUN apt-get update -qq && \
    apt-get install --no-install-recommends -y curl build-essential git pkg-config && \
    rm -rf /var/lib/apt/lists /var/cache/apt/archives

RUN curl -L -o bin/tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/download/v4.0.0-beta.2/tailwindcss-linux-x64 && \
    chmod a+x ./bin/tailwindcss

RUN ./bin/tailwindcss --help

command: docker buildx build --platform linux/amd64 --file Dockerfile.tw . Describe your issue

When trying to execute the beta executable in x86 for linux, it errors with '0.054 Illegal instruction'

Robert344Humphries commented 4 days ago

You're encountering an "0.054 Illegal instruction" error when running the Tailwind CSS v4.0.0-beta.2 executable on an x86 Linux system. This issue My Great Lakes is likely due to CPU architecture compatibility. To resolve this, ensure the binary matches your CPU architecture, consider building Tailwind CSS from source, use a stable version, and ensure your Docker configuration is correct.

Christin602Bey commented 2 days ago

Hello! It sounds like you're running into an issue with the Tailwind CSS beta executable on an x86 Linux environment. The error message 0.054 Illegal instruction usually indicates that the executable is not compatible with the CPU architecture of your system. Ensure that the Tailwind CSS executable you downloaded is compatible with your system's architecture. You might need to download a version specifically built for your CPU architecture. Make sure all your dependencies, including Docker, Ruby, and any libraries, are up to date. Sometimes, updating these can resolve compatibility issues. If the pre-built executable isn't working, you could try building Tailwind CSS from source. This might involve additional setup but can ensure compatibility with your specific environment. Review the Tailwind CSS and Docker documentation for any known issues or additional setup instructions related to your specific setup.