Build hangs on In progress with Docker

I’m looking for a way to deploy my Java application on Render.
I know Render doesn’t support Java natively, but support Docker so I should be fine.

To begin, I’ve written the following Dockerfile.

FROM registry.access.redhat.com/ubi8/openjdk-17:1.14

ENV LANGUAGE='en_US:en'

COPY --chown=185 .mvn/ .mvn
COPY --chown=185 src/ src
COPY --chown=185 mvnw pom.xml ./
RUN ./mvnw package -DskipTests

RUN mv target/quarkus-app/lib/ /deployments/lib/
RUN mv target/quarkus-app/*.jar /deployments/
RUN mv target/quarkus-app/app/ /deployments/app/
RUN mv target/quarkus-app/quarkus/ /deployments/quarkus/

EXPOSE 8080
USER 185
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"

It’s worth nothing that I’m able to build and run the project on my local machine with the following command.

 docker build -f src/main/docker/Dockerfile -t quarkus/quarkus-render-demo-jvm . && docker run -i --rm -p 8080:8080 quarkus/quarkus-render-demo-jvm

Then I’ve created a new Render project with the following settings.

Type: Web Service
Environment: Docker
Dockerfile Path: ./src/main/docker/Dockerfile
Docker Command: docker build -f src/main/docker/Dockerfile -t quarkus/quarkus-render-demo-jvm . && docker run -i --rm -p 8080:8080 quarkus/quarkus-render-demo-jvm

The build (apparently) proceeds fine until the end, but never complete. It hangs on In Progress with those lines in the log.

Nov 6 12:45:55 PM  #15 exporting to oci image format
Nov 6 12:46:05 PM  #15 DONE 16.8s
Nov 6 12:46:05 PM  
Nov 6 12:46:05 PM  #16 exporting cache
Nov 6 12:46:05 PM  #16 preparing build cache for export
Nov 6 12:46:06 PM  #16 DONE 1.1s
Nov 6 12:46:07 PM  Pushing image to registry...
Nov 6 12:46:10 PM  DONE

What am I doing wrong?

Hey Andrea,

This causes a bit of confusion and something we need to address in our docs Docker Command in our UI and render.yaml overrides the entrypoint in the Docker file - it’s not the Docker command to execute,

Regards,

John B

Thanks John, it was indeed a misuse of the Docker Command from me. I was able to successfully deploy the container adding a CMD line at the end of the Dockerfile as listed here, and removing that custom Docker Command from the Render project settings.

1 Like