Run IronPDF on Linux ARM64 in Docker

IronPDF's renderer is built on the Chromium Embedded Framework (CEF), which needs more Thread Local Storage (TLS) than the Linux dynamic linker reserves by default on ARM and ARM64. Without a workaround, loading libcef.so fails with cannot allocate memory in static TLS block. The fix is to preload libcef.so through the LD_PRELOAD environment variable so the linker reserves enough TLS before anything else loads.

For the bare error message and the non-Docker fix, see IronPDF on Linux ARM: cannot allocate memory in static TLS block. This article applies the same fix inside a container.

Set LD_PRELOAD in the Dockerfile

Add the variable as an ENV instruction pointing at the ARM64 native library that ships with IronPDF:

ENV LD_PRELOAD=/app/runtimes/linux-arm64/native/libcef.so

Sample Dockerfile

This multi-stage Dockerfile builds and runs an IronPDF app on .NET 8 for ARM64, installs the native libraries CEF depends on, and sets LD_PRELOAD in the final image:

# Base image for runtime (ARM64)
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
USER root
WORKDIR /app
RUN apt update \
    && apt install -y sudo libxkbcommon-x11-0 libc6 libc6-dev libgtk2.0-0 libnss3 libatk-bridge2.0-0 libx11-xcb1 libxcb-dri3-0 libdrm-common libgbm1 libasound2 libxrender1 libfontconfig1 libxshmfence1 libgdiplus libva-dev
# Base image for build (ARM64)
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish -c Release -o /app/publish
# Final image with IronPdf and system dependencies
FROM base AS final
WORKDIR /app
ENV LD_PRELOAD=/app/runtimes/linux-arm64/native/libcef.so
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "IronPdfLinuxArm.dll"]

Set LD_PRELOAD to the path where libcef.so actually lands in your image; the value above matches the default runtimes/linux-arm64/native/ layout. The underlying limitation is tracked on the CEF Forum.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 19,533,604 | Version: 2026.6 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronPdf
run a sample watch your HTML become a PDF.