Follow the steps here: docker build .

Use 2.5.2 version

My dockerfile

FROM openjdk:11

RUN mkdir /opt/app

WORKDIR /opt/app

ADD ./build/libs/app*.jar ./app.jar

EXPOSE 8080 5005

CMD exec java $JAVA_OPTS -jar /opt/app/app.jar

bellow follow error: When using ADD with more than one source file, the destination must be a directory and end with a /

In my last version 2.4.5 its work

Comment From: wilkinsona

Your Dockerfile is assuming that there’s only a single file in build/libs that matches app*.jar. That doesn’t hold true in Spring Boot 2.5 due to this change.

You should either update your Dockerfile to identify a single file from build/libs or update your build to disable the jar task.