I have a very simple Azure Container Instance running from a Docker container based on AdoptOpenJDK. The Dockerfile has nothing but:
FROM adoptopenjdk:11-jre-hotspot
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-jar","/app.jar"]
The application itself is a very simple Spring Boot Application exposing a REST API. It currently does nothing but expose a simple request for testing. The application is not doing any logic so there is nothing related to load or resource consumption. In fact the graph shows a practically constant usage at around 285Mb. According to the Properties of the container it has 1.5Gb of memory, so it shouldnt be a resource issue.
However, after a few hours of running happily, the container is just killed. I am also noticing it on a more complex application, but I wanted to verify it with a simpler one.
I am deploying the container with this command:
az container create --dns-name-label $ACI_CONTAINER_NAME --resource-group $AZURE_RESOURCE_GROUP --name $ACI_CONTAINER_NAME --image $IMAGE_NAME:latest --registry-username $ACR_USERNAME --registry-password $ACR_PASSWORD --restart-policy Never --ports 80 --environment-variables $MY_VARIABLES --secure-environment-variables $MY_SECURE_VARIABLES
I have set the restart policy on purpose to Never so that I can see the logs of the container, but there is nothing that shows any problem.
Sometimes the container is killed after a few hours, sometimes after a bit longer. In this case it was killed after 20hrs.
I can see nothing else in the container logs.
How can I know what is going on? Why is ACI just killing my instances arbitrarily?