We are attempting to use Azure functions (HTTP trigger) to trigger a Java executable (JAR) in a Dockerfile. We are able to build, tag, and run the image locally with VSCode. However, when we push it to Azure, we receive a function runtime unreachable error.
The logs show:
'container didn't respond to http pings on port 4444 or 8080'
We tried the following:
- Added
WEBSITES_PORT
for4444
and8080
. - We also exposed those ports one at a time within the Dockerfile while pushing it.
- We changed the value of
WEBSITES_CONTAINER_START_TIME_LIMIT
to1800
and other values with no success.
The deployment center log show a message stating the docker image has been pulled successfully:
INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
INFO - Starting container for site
INFO - docker run -d -p 8080:8080 --name xxxx -e DOCKER_CUSTOM_IMAGE_NAME=notreal.azurecr.io/xxxx -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=8080 -e WEBSITE_SITE_NAME=xxxx -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=xxxx.azurewebsites.net -e WEBSITE_INSTANCE_ID=abcdef abcdef.azurecr.io/xxxx
INFO - Logging is not enabled for this container. Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
INFO - Initiating warmup request to container xxxx for site xxxx
INFO - Waiting for response to warmup request for container xxxx. Elapsed time = 15.5217224 sec
INFO - Waiting for response to warmup request for container xxxx. Elapsed time = 107.7627672 sec
ERROR - Container xxxx for site xxxx is not running, failing site start
ERROR - Container xxxx didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
We've looked at numerous examples on Stack Overflow, but haven't been able to resolve this yet.