Skip to content

biome is very slow when run inside container compared to native (~10x) #29

@ulrichbaur

Description

@ulrichbaur

When trying to integrate this docker image for use in Gitlab CI, I noticed that biome takes about 10x longer to execute when using this image compared to running biome natively. This is reproducable outside of Gitlab CI and the reason seems to be that the image is based on alpine. My assumption is that it has something to do with alpine using musl instead of glibc.

When I swap out the base image to debian:slim , the performance is very close to native. For additional context, all the systems I'm working with are using x64, so I haven't had the chance to try it out on other architectures.

FROM debian:trixie-slim AS fetcher

ARG ARCH="x64"
ARG BIOME_VERSION=1.9.4

ENV BIOME_VERSION=${BIOME_VERSION}

# biome v1
ADD https://github.com/biomejs/biome/releases/download/cli/v${BIOME_VERSION}/biome-linux-${ARCH} /usr/local/bin/biome

# biome v2
# ADD https://github.com/biomejs/biome/releases/download/@biomejs/biome@${BIOME_VERSION}/biome-linux-${ARCH} /usr/local/bin/biome

RUN chmod +x /usr/local/bin/biome

FROM debian:trixie-slim AS biome

WORKDIR /code

RUN apt update && apt install -y git && rm -rf /var/lib/apt/lists/* && git config --global --add safe.directory /code
COPY --from=fetcher /usr/local/bin/biome /usr/local/bin/biome

ENTRYPOINT [ "/usr/local/bin/biome" ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions