I have a Dockerfile
as below, tested to work on Unix systems. My client is trying to use the same on a windows but getting a Permission denied
error on RUN ./gradlew clean deployNodes
step.
How do I tweak my Dockerfile
so that it works on a Windows system as well?
# Get java8
FROM openjdk:8-jre-slim
# Get gradle
FROM gradle:4.7.0-jdk8-alpine AS build
# Start as root to update the alpine image to install bash
USER root
# Add bash
RUN apk update && apk add bash
# Move the code, as owner
COPY --chown=gradle:gradle . /home/gradle/src
# Assign a working directory
WORKDIR /home/gradle/src
# Run clean build
RUN ./gradlew clean deployNodes
# Expose ports for the services
EXPOSE 8080 5005 5006 5007 5008 5009 10001 10070
# Run the application
ENTRYPOINT ["build/nodes/runnodes"]
Edit:
The error is in :
/bin/sh: ./gradlew: Permission denied
The command '/bin/sh -C ./gradlew clean deploynodes' returned a non-zero code: 126
Following this thread I have made gradlew
an executable:
gradlew: Permission Denied