I am using Ubuntu 22.04
File docker-build.sh
#!/usr/bin/env bash
if [ "$1" = "native" ];
then
./mvnw clean -Pnative spring-boot:build-image --projects book-service -DskipTests
else
./mvnw clean compile jib:dockerBuild --projects book-service
fi
or online link at https://github.com/ivangfr/springboot-kong-keycloak/blob/main/docker-build.sh
./docker-build.sh
error
./docker-build.sh: ./mvnw: /bin/sh^M: bad interpreter: No such file or directory
How to fix it?
./mvnw
script (rather than thedocker-build.sh
script itself) likely has DOS-style line endings. See for example Not able to execute a .sh file: /bin/bash^M: bad interpreter – steeldriver Sep 15 '23 at 11:18