R
Railway10mo ago
lotario

Dockerfile deployment fails

Hello. To deploy a Java 21 app I'm using a dockerfile posted by another Railway user for the same purpose (I've only added my own variables): FROM eclipse-temurin:21-jdk as build COPY . /app WORKDIR /app RUN ./mvnw clean package -DskipTests RUN mv -f target/.jar app.jar FROM eclipse-temurin:21-jre ARG DATABASE_URL ARG DATABASE_USERNAME ARG DATABASE_PASSWORD ARG PORT ENV PORT=${PORT} COPY --from=build /app/app.jar . RUN useradd runtime USER runtime ENTRYPOINT [ "java", "-Dserver.port=${PORT}", "-jar", "app.jar" ] The error in the logs is: #10 [build 4/5] RUN ./mvnw clean package -DskipTests #10 0.263 /bin/sh: 1: ./mvnw: Permission denied #10 ERROR: process "/bin/sh -c ./mvnw clean package -DskipTests" did not complete successfully: exit code: 126 -----
[build 4/5] RUN ./mvnw clean package -DskipTests:
0.263 /bin/sh: 1: ./mvnw: Permission denied ----- Dockerfile:4 ------------------- 2 | COPY . /app 3 | WORKDIR /app 4 | >>> RUN ./mvnw clean package -DskipTests 5 | RUN mv -f target/
.jar app.jar 6 | ------------------- ERROR: failed to solve: process "/bin/sh -c ./mvnw clean package -DskipTests" did not complete successfully: exit code: 126 Project ID: fccc699b-2959-453f-9818-2fc046a08b12 I don't know where to go from here, any help is appreciated! Thanks!
Solution:
Try adding a chmod +x mvnw somewhere in your build process.
Jump to solution
9 Replies
Percy
Percy10mo ago
Project ID: fccc699b-2959-453f-9818-2fc046a08b12
lotario
lotarioOP10mo ago
Brody
Brody10mo ago
@aleks - java time
root
root10mo ago
Are you developing this on Windows?
Solution
root
root10mo ago
Try adding a chmod +x mvnw somewhere in your build process.
lotario
lotarioOP10mo ago
Yes I'm on Windows 11
root
root10mo ago
try this then
lotario
lotarioOP10mo ago
That worked, thank you very much!
Want results from more Discord servers?
Add your server