I would like to build a Spring Boot app using the maven wrapper provided by spring.io.starter inside a docker container. My Dockerfile is:
FROM openjdk:8-jdk-alpine
# install bash --> commented because I just need /bin/sh which is already provided by the base image
#RUN apk add --no-cache bash
ENV APP_DIR /app
ENV APP app.jar
WORKDIR ${APP_DIR}
COPY . ${APP_DIR}
# ===> HERE THE PROBLEM
RUN /bin/sh -c "./mvnw clean install"
ENTRYPOINT ["java","-jar","chicowa-app.jar"]
EXPOSE 8080
I have this error:
/bin/sh: ./mvnw: not found
After making some researches I still don't find a solution.
My docker version
Docker version 18.06.1-ce, build e68fc7a
on Windows10 pro
Thanks a lot for your help.
EDIT
A solution would be to install maven directly with a RUN apk add --no-cache maven
but I would like to minimize as possible the image' size.