Adding IronPDF to an Existing Docker Container

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPDF for .NET Standard now fully supports Docker, including Azure Docker Containers for Linux and Windows.

Do you want to deploy IronPDF as a separate Docker container instead? Learn more about the IronPDFEngine tutorials guide.

Docker Logo
Azure Logo
Linux Logo
AWS Logo
Windows Logo

Why use Docker on Azure?

Alongside excellent enterprise scalability, Docker Containers on Azure enjoy more permissions than regular WebApps. This allows rendering of SVG fonts because system access to GDI+ graphics is enabled.

IronPDF and Linux Primer

If Docker with .NET is new to you, we recommend this excellent article on setting up Docker debugging and integration with Visual Studio projects.

We also highly recommend you read our IronPDF Linux Setup and Compatibility Guide

We recommend the latest 64-bit Linux OS's below for "easy configuration" of IronPDF.

We recommend using Microsoft's Official Docker Images for .NET. Other Linux distros are supported in part, but may require manual configuration. See our "Linux Manual Setup" guide.

IronPDF Linux Docker Installation

Use Linux Optimised NuGet Packages

We recommend using the IronPdf.Linux NuGet package instead of the regular IronPdf package to save disk space and avoid assets being downloaded when you start your Docker instance. Don't worry, it still works when developing on Windows or macOS - it is just Linux optimized.

Install-Package IronPdf.Linux

Another solution is to simply add IronPdf.Native.Chrome.Linux on top of the regular IronPdf NuGet package.

Install-Package IronPdf.Native.Chrome.Linux

Avoid Automatic Dependency Installation

Many users report better results with Linux & Docker when LinuxAndDockerDependenciesAutoConfig is set to false. This is because the prerequisites are already installed by apt-get style package managers in your Docker files.

// Disable automatic configuration of Linux and Docker dependencies
IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = false;
// Disable automatic configuration of Linux and Docker dependencies
IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = false;
' Disable automatic configuration of Linux and Docker dependencies
IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = False
$vbLabelText   $csharpLabel

Disable GPU Acceleration

Linux Docker containers often do not have access to a GPU. GPU acceleration is disabled by default. If you have enabled ChromeGpuModes.Enabled, we highly recommend you disable it for Docker deployments:

// Disable GPU acceleration for Docker environments
IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
// Disable GPU acceleration for Docker environments
IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
' Disable GPU acceleration for Docker environments
IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled
$vbLabelText   $csharpLabel

Ubuntu Linux Docker Files

Docker Logo
Ubuntu Logo

Ubuntu 22 with .NET 8

Ubuntu 22 with .NET 7

Ubuntu 20 with .NET 6

Ubuntu 20 with .NET 5

Ubuntu 20 with .NET 3.1 LTS

Ubuntu 18 with .NET 3.1 LTS

Debian Linux Docker Files

Docker Logo
Debian Logo

Debian 12 with .NET 8

Debian 11 with .NET 7

Debian 11 with .NET 6

Debian 11 with .NET 5

Debian 11 with .NET 3.1 LTS

Debian 10 with .NET 5

Debian 10 with .NET 3.1 LTS

Alpine Linux Docker Files

Running IronPDF on Alpine Linux is not supported. We wish we could but we can't. Frankly, we like Alpine and hope this project continues and grows. As of 2023, Alpine still uses outdated "musl" C language libraries that do not allow chromium developers to fully support this OS yet.

Using Alpine Docker with IronPdfEngine in .NET 6

IronPDF provides a container image containing all IronPDF functionalities. This enables projects running on Alpine to access IronPD functionalities by connecting to the IronPdfEngine container.

Step 1: Pull and Run IronPDF Engine Docker Image

Execute the following commands in your terminal to pull and run the IronPDF Engine Docker image:

# Pull the IronPDF Engine Docker Image
docker pull ironsoftwareofficial/ironpdfengine
# Pull the IronPDF Engine Docker Image
docker pull ironsoftwareofficial/ironpdfengine
SHELL
# Run the IronPDF Engine Docker container
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine
# Run the IronPDF Engine Docker container
docker run -d -p 33350:33350 ironsoftwareofficial/ironpdfengine
SHELL

Step 2: Set Up Console App

Create a new console application targeting .NET 6. Install the IronPdf.Slim NuGet package using the NuGet Package Manager.

Windows Docker File

Docker Logo
Windows Logo

Windows Docker Containers are becoming increasingly popular on Azure, as they offer higher levels of performance and scalability and give developers more permissions to configure instances.

IronPDF will actually perform more attractive text rendering within a Docker container (Windows or Linux) on Azure due to higher levels of access to graphics library and the virtual graphics card.

The article 'Visual Studio Container Tools for Docker' is a really great get-started guide.

This is an example Windows container Dockerfile for .NET Core 3.1

Windows Server 2019 .NET 6.0

Pre-configured Windows containers include all the necessary dependencies for running IronPDF.

Por favor notaNote that these containers are not intended for BUILDING .NET applications, but rather for RUNNING them.

Visit the Docker repository to explore additional pre-configured images for running IronPDF.

Preguntas Frecuentes

¿Cómo puedo integrar una biblioteca .NET para la generación de PDF en un contenedor Docker?

Puedes integrar IronPDF, una biblioteca .NET para la generación de PDF, en un contenedor Docker utilizando las imágenes Docker oficiales de Microsoft y el paquete NuGet IronPdf.Linux para Linux, o contenedores Docker preconfigurados para entornos Windows.

¿Cuáles son los beneficios de usar contenedores Docker para manipulación de PDF en Azure?

El uso de contenedores Docker para la manipulación de PDF en Azure proporciona una escalabilidad empresarial mejorada y más permisos que las aplicaciones web normales. Esta configuración es ideal para habilitar funciones avanzadas como el renderizado de fuentes SVG a través del acceso a gráficos GDI+.

¿Qué distribuciones de Linux son más adecuadas para ejecutar una biblioteca .NET para PDF en Docker?

Las distribuciones de Linux más adecuadas para ejecutar IronPDF en Docker incluyen Ubuntu 18/20/22, Debian 10/11, CentOS 8 y Amazon AWS Linux 2, ya que ofrecen una configuración y compatibilidad sencillas.

¿Cómo puedo optimizar el rendimiento de una biblioteca .NET para PDF en contenedores Docker de Linux?

Para optimizar el rendimiento, utiliza el paquete IronPdf.Linux, desactiva la instalación automática de dependencias y apaga la aceleración de GPU configurando IronPdf.Installation.ChromeGpuMode a IronPdf.Engines.Chrome.ChromeGpuModes.Disabled.

¿Puede ejecutar IronPDF en Alpine Linux dentro de un contenedor Docker?

IronPDF no admite nativamente Alpine Linux debido a las bibliotecas 'musl' incompatibles. Para usar IronPDF en Alpine Linux, considera ejecutarlo a través de un contenedor Docker de IronPdfEngine.

¿Cuál es el propósito de usar contenedores Docker preconfigurados para una biblioteca .NET?

Los contenedores Docker preconfigurados proporcionan todas las dependencias necesarias para ejecutar IronPDF de manera eficiente, asegurando un alto rendimiento y escalabilidad, particularmente beneficioso al implementar en plataformas como Azure.

¿Cómo puedo configurar una biblioteca .NET para PDF para aplicaciones .NET en Docker?

Puedes configurar IronPDF para aplicaciones .NET en Docker integrándolo con contenedores Docker tanto para Linux como para Windows, habilitando robustas funcionalidades de PDF dentro de una arquitectura de microservicios.

¿Cuáles son los pasos de configuración recomendados para implementar una biblioteca .NET en Docker?

Los pasos recomendados incluyen el uso de un paquete optimizado para Linux como IronPdf.Linux, la desactivación de instalaciones automáticas de dependencias y la preinicialización de IronPDF para evitar retrasos durante el tiempo de ejecución en entornos Docker.

¿Cómo configuro una biblioteca .NET para PDF en un contenedor Docker de Windows Server 2019 ejecutando .NET 6.0?

Configura una biblioteca .NET para PDF en un contenedor Docker de Windows Server 2019 utilizando un Dockerfile preconfigurado que incluya todas las dependencias y configuraciones necesarias para ejecutar IronPDF con .NET 6.0.

¿Por qué deshabilitar la aceleración de GPU en una configuración Docker para una biblioteca .NET?

Deshabilitar la aceleración de GPU para IronPDF en Docker puede llevar a un despliegue y rendimiento más fluidos al evitar problemas potenciales relacionados con gráficos en entornos donde los recursos de GPU son limitados.

Curtis Chau
Escritor Técnico

Curtis Chau tiene una licenciatura en Ciencias de la Computación (Carleton University) y se especializa en el desarrollo front-end con experiencia en Node.js, TypeScript, JavaScript y React. Apasionado por crear interfaces de usuario intuitivas y estéticamente agradables, disfruta trabajando con frameworks modernos y creando manuales bien ...

Leer más
¿Listo para empezar?
Nuget Descargas 16,154,058 | Versión: 2025.11 recién lanzado