Setting up IronBarcode in Docker Containers
IronBarcode fully supports Docker, including containers in Azure and AWS for Linux and Windows.
Why use Docker?
Docker enables developers to easily pack, ship, and run any application as a lightweight, portable, self-sufficient container, which can run virtually anywhere.
IronBarcode 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.
For working with IronBarcode in Linux, we also highly recommend you read our IronBarcode Linux setup and compatibility guide.
Recommended Linux Docker Distributions
We recommend using the following 64-bit Linux distributions for the least hassle in configuring IronBarcode, matching the distros Microsoft currently ships official .NET 8 container images for:
- Ubuntu 24.04 (Noble)
- Ubuntu 22.04 (Jammy)
- Debian 12 (Bookworm)
- RHEL / UBI 8 or 9 (for RHEL-family deployments — see below; Microsoft no longer publishes official CentOS runtime images)
We recommend using Microsoft's official Docker images. Other Linux distros are supported in part, but may require manual configuration and dependency installations. See our Linux manual setup guide for more information on how to set up with Linux.
IronBarcode Linux Docker Installation Essentials
Use Our NuGet Package
We recommend using the IronBarcode NuGet Package—it works seamlessly when developing on Windows, macOS, and Linux.
Install-Package BarCode
Ubuntu Linux Dockerfiles
Ubuntu 24.04 (Noble) with .NET 8 LTS
# Base runtime image (Ubuntu 24.04 with .NET runtime)
FROM mcr.microsoft.com/dotnet/runtime:8.0-noble AS base
WORKDIR /app
# Install necessary packages
RUN apt update
# Base development image (Ubuntu 24.04 with .NET SDK)
FROM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
WORKDIR /src
# Restore NuGet packages
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
# Build project
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
# Publish project
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
# Final image to run the app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
Ubuntu 22.04 (Jammy) with .NET 8 LTS
# Base runtime image (Ubuntu 22.04 with .NET runtime)
FROM mcr.microsoft.com/dotnet/runtime:8.0-jammy AS base
WORKDIR /app
# Install necessary packages
RUN apt update
# Base development image (Ubuntu 22.04 with .NET SDK)
FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /src
# Restore NuGet packages
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
# Build project
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
# Publish project
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
# Final image to run the app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
Debian Linux Dockerfiles
Debian 12 (Bookworm) with .NET 8 LTS
# Base runtime image (Debian 12 with .NET runtime)
FROM mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim AS base
WORKDIR /app
# Install necessary packages
RUN apt update
# Base development image (Debian 12 with .NET SDK)
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build
WORKDIR /src
# Restore NuGet packages
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
# Build project
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
# Publish project
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
# Final image to run the app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]
RHEL / UBI Dockerfiles
Microsoft no longer publishes official CentOS runtime images (CentOS 7 is end-of-life). For RHEL-family deployments, use Red Hat's own Universal Base Image (UBI) .NET containers instead — they're freely usable without a Red Hat subscription and are kept current with supported .NET releases.
RHEL UBI 8 with .NET 8 LTS
# Base runtime image (UBI 8 with .NET 8 runtime)
FROM registry.access.redhat.com/ubi8/dotnet-80-runtime:8.0 AS base
WORKDIR /app
# Base development image (UBI 8 with .NET 8 SDK)
FROM registry.access.redhat.com/ubi8/dotnet-80:8.0 AS build
WORKDIR /src
# Restore NuGet packages
COPY ["Example/Example.csproj", "Example/"]
RUN dotnet restore "Example/Example.csproj"
# Build project
COPY . .
WORKDIR "/src/Example"
RUN dotnet build "Example.csproj" -c Release -o /app/build
# Publish project
FROM build AS publish
RUN dotnet publish "Example.csproj" -c Release -o /app/publish
# Final image to run the app
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Example.dll"]Frequently Asked Questions
How can I set up a barcode application in Docker on Linux?
To set up a barcode application in Docker on Linux, you can use IronBarcode. Begin by pulling the appropriate .NET Docker image, install the IronBarcode NuGet package using dotnet add package IronBarCode, and configure your Dockerfile to build and run your application in a container.
Which Linux distributions are best for running Docker with barcode applications?
The recommended Linux distributions for running Docker with barcode applications using IronBarcode are Ubuntu 24.04 or 22.04, Debian 12, and RHEL/UBI 8 or 9 — the distributions Microsoft currently ships official .NET 8 container images for.
What are the benefits of using Docker for barcode applications?
Using Docker for barcode applications allows for containerization, which makes applications lightweight, portable, and consistent across different environments. This is particularly beneficial for deploying applications on cloud services like Azure and AWS.
How do I troubleshoot Docker setup issues with barcode libraries?
Common issues in Docker setups with barcode libraries can often be resolved by ensuring all dependencies are correctly installed and that the Dockerfile is properly configured. Using the official Microsoft .NET images can help streamline the process.
Can I run barcode applications in Docker on cloud platforms?
Yes, you can run barcode applications in Docker containers on cloud platforms such as Azure and AWS. IronBarcode supports these environments, whether on Linux or Windows.
What is the process to install the barcode library in a Docker container?
Install the IronBarcode library in a Docker container by adding the IronBarCode NuGet package to your .NET project using dotnet add package IronBarCode in your Docker setup process.
How do I ensure compatibility of barcode applications across different environments?
To ensure compatibility across different environments, use Docker to containerize your barcode application and manage dependencies via the IronBarCode NuGet Package. This approach provides a consistent environment for your application.
What .NET versions are recommended for building Docker images for barcode applications?
It is recommended to use .NET 8 LTS for stability and long-term support when building Docker images for barcode applications.
Is IronBarcode compatible with .NET 10, and can I use it in Docker on Linux with .NET 10?
Yes. IronBarcode supports .NET 10 — along with .NET 9, 8, 7, 6, 5, .NET Core, .NET Standard, and .NET Framework 4.6.2+ — and it works in Docker containers on Linux. ([ironsoftware.com](https://ironsoftware.com/csharp/barcode/features/compatibility/?utm_source=openai))
Does IronBarcode support batch processing of barcodes?
Yes, IronBarcode supports batch processing, allowing developers to generate or read multiple barcodes in a single operation, enhancing efficiency for large-scale applications.

