Compartir a través de

Java ContainerApps container base image doesn't include libfreetype.so

Vicente Quiles Saez 0 Puntos de reputación
2025-04-14T14:36:59.8166667+00:00

Hi,

In Azure Container Apps, if I choose to deploy a JAVA APP without my own Dockerfile - that is, via source code or JAR file - I'll get an image that doesn't have libfreetype.so. I need that library, among others, to be builder PDF reports. And I cannot add those libraries and project dependencies.

I can solve this building my own image and choosing a JDK base image that has those libraries but, in that case, I'm unable to use the automatic memory fitting.

Also, as I don't have any control over the building of the image, I cannot add those libraries.

Is there a way to have those libraries available and being able to use the automatic memory fitting?

Centro de la comunidad | Analizar el sitio de preguntas y respuestas | Introducción a preguntas y respuestas
0 comentarios No hay comentarios

1 respuesta

Ordenar por: Muy útil
  1. Gao Chen 10,780 Puntos de reputación Personal externo de Microsoft Moderador
    2025-04-15T00:05:00.37+00:00

    Hello Vicente Quiles Saez,

    Welcome to Microsoft Q&A!

    Deploying a Java application in Azure Container Apps without a custom Dockerfile can indeed limit your ability to include specific libraries like libfreetype.so. However, there are a few strategies you might consider to achieve your goal while still leveraging automatic memory fitting:

    Custom Buildpacks

    Azure Container Apps supports buildpacks, which can be used to customize the build process of your application. You can create a custom buildpack that includes the necessary libraries and dependencies. This way, you can still deploy your application without a Dockerfile but have control over the build environment.

    Use Azure Functions

    If your application can be split into smaller functions, you might consider using Azure Functions. Azure Functions can be configured to use custom Docker images, allowing you to include the necessary libraries while still benefiting from automatic scaling and memory fitting.

    Hybrid Approach

    You can use a combination of Azure Container Apps and Azure Kubernetes Service (AKS). Deploy your main application in Azure Container Apps to benefit from automatic memory fitting, and deploy a sidecar container in AKS with the necessary libraries. The sidecar container can handle the PDF report generation and communicate with the main application.

    Environment Variables and Startup Scripts

    If you have some control over the startup process of your application, you might be able to use environment variables and startup scripts to download and install the necessary libraries at runtime. This approach can be tricky and might not be suitable for all applications, but it's worth exploring.

    Azure App Service

    Consider using Azure App Service, which provides more flexibility in terms of configuring the runtime environment. You can use custom startup commands to install additional libraries and dependencies.

    If none of the above solutions are feasible, it might be worth reaching out to Azure Support. They can provide guidance specific to your use case and might offer solutions that are not widely documented. I hope the information provided was useful, please let me know if you have any concerns with the information and I will be more than glad to help.

    Regards,

    Gao


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    ¿Le ha resultado útil esta respuesta?


Su respuesta

Las respuestas pueden ser marcadas como "Aceptadas" por el autor de la pregunta y "Recomendadas" por los moderadores, lo que ayuda a los usuarios a saber que la respuesta ha resuelto el problema del autor.