Usage in Docker and AWS
This page explains how to run List & Label Cross Platform within a Docker container and deploy your containerized application to AWS using Amazon Elastic Container Service (ECS) with Fargate.
Running in Docker
List & Label Cross Platform can be used in Docker containers based on
.NET 10, .NET 9, or .NET 8.
The examples below use .NET 10 as the default.
To use .NET 9 or .NET 8, keep the structure and only adjust the image tags
(as described in the notes below).
Note
List & Label Cross Platform requires additional native Linux packages for font handling and image rendering. These must be installed explicitly in your Docker image.
When running on Linux, you must also reference the NuGet package SkiaSharp.NativeAssets.Linux, which provides the required native rendering components.
Dockerfile variants (overview)
Choose the Dockerfile variant that best fits your environment:
| Variant | Base image | Package manager | Recommended when |
|---|---|---|---|
| Debian / Ubuntu | mcr.microsoft.com/dotnet/aspnet:10.0 |
apt-get |
maximum compatibility, easiest troubleshooting |
| Alpine | mcr.microsoft.com/dotnet/aspnet:10.0-alpine |
apk |
smaller image size |
Note
List & Label Cross Platform supports .NET 10, .NET 9, and .NET 8. Only the image tags need to be changed for different .NET versions. Package names may differ slightly depending on the Linux distribution.
Use this variant when your runtime image is based on Debian or Ubuntu
(e.g. mcr.microsoft.com/dotnet/aspnet:10.0).
# Build and publish the application
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish -c Release -o /app/publish
# Runtime image
FROM mcr.microsoft.com/dotnet/aspnet:10.0
WORKDIR /app
COPY --from=build /app/publish ./
USER root
# Install native dependencies required by List & Label Cross Platform
RUN apt-get update && apt-get install -y \
libc6 \
libfontconfig1 \
libfreetype6 \
libpng16-16 \
libjpeg62 \
libgif7 \
fonts-dejavu-core \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["dotnet", "YourApplication.dll"]
Note
Depending on the Debian/Ubuntu version behind the base image,
the JPEG package may be named libjpeg62 or libjpeg62-turbo.
If installation fails, check the available package names and adjust
accordingly.
Tip
To use a different .NET version:
.NET 9
mcr.microsoft.com/dotnet/sdk:9.0
mcr.microsoft.com/dotnet/aspnet:9.0.NET 8
mcr.microsoft.com/dotnet/sdk:8.0
mcr.microsoft.com/dotnet/aspnet:8.0
Deploying to AWS ECS and Fargate
AWS offers several services for running containerized applications. The recommended approach is to use Amazon ECS with Fargate, which allows you to run containers without managing the underlying infrastructure.
Steps to deploy
Build your Docker image:
Build the image locally or within your CI/CD pipeline using your Dockerfile:docker build -t mylistlabelapp .Push the image to Amazon ECR:
Create an Amazon ECR repository and push your image there. Use the following commands (replace<aws_account_id>and<region>with your actual values):aws ecr get-login-password --region <region> | docker login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com docker tag mylistlabelapp:latest <aws_account_id>.dkr.ecr.<region>.amazonaws.com/mylistlabelapp:latest docker push <aws_account_id>.dkr.ecr.<region>.amazonaws.com/mylistlabelapp:latestCreate an ECS cluster:
In the AWS Management Console, create a new ECS cluster configured for Fargate. This provides the orchestration needed to run your containerized application.Define a task definition:
Create a task definition that specifies:- The container image (from your ECR repository)
- Port mappings
- Environment variables and any necessary runtime settings
Deploy a service:
Using your task definition, create an ECS service that runs your container on Fargate. Configure options such as:- Desired task count
- Auto-scaling policies
- Load balancing (if needed)
Monitor and manage:
Use AWS CloudWatch to monitor logs, metrics, and application performance. This helps you ensure that your application runs smoothly in production.
Additional resources
By following these steps, you can successfully containerize your List & Label Cross Platform application and deploy it on AWS ECS with Fargate. This setup ensures that your application benefits from AWS's scalable infrastructure and integrated monitoring tools.