I'm trying to run a hello word java application in docker. The application is produced by gradle init. I use gradle installDist to generate runnable file. I can run the runnable locally without any problem. But I got the error when I try to run from docker. Here is the docker file content:
FROM gradle:7.1.0-jdk11 AS builder
WORKDIR /home/gradle/src
COPY --chown=gradle:gradle . /home/gradle/src
RUN gradle installDist
FROM openjdk:17-oracle
COPY --from=builder /home/gradle/src/build/install/app/ /app/
WORKDIR /app
CMD ["bin/app"]
The docker file is placed in the same folder with build.gradle and the docker build command is ran from that folder. Build runs successfully. But as long as I click run in the docker GUI, the container fails immediately with error message "xargs is not available"