abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
510 stars 122 forks source link

Problem building from Dockerfile #694

Closed jmizv closed 5 months ago

jmizv commented 6 months ago

I've downloaded the Dockerfile and executed the command as suggested but I got:

 => CACHED [build 3/5] WORKDIR /tmp/brouter                                                                                                                                                                                                                                            0.0s
 => [build 4/5] COPY . .                                                                                                                                                                                                                                                               0.9s
 => ERROR [build 5/5] RUN ./gradle clean build                                                                                                                                                                                                                                         0.3s
------
 > [build 5/5] RUN ./gradle clean build:
0.262 /bin/sh: 1: ./gradle: not found
------
Dockerfile:6
--------------------
   4 |     WORKDIR /tmp/brouter
   5 |     COPY . .
   6 | >>> RUN ./gradle clean build
   7 |     
   8 |     FROM openjdk:17.0.1-jdk-slim
--------------------
ERROR: failed to solve: process "/bin/sh -c ./gradle clean build" did not complete successfully: exit code: 127

I work on Ubuntu 22.4. Did I miss something?

zod commented 6 months ago

It seems like you modified the Dockerfile. It calls the Gradle wrapper ./gradlew.

You also need to clone the whole repository, not just download the Dockerfile

jmizv commented 6 months ago

It seems like you modified the Dockerfile. It calls the Gradle wrapper ./gradlew.

You also need to clone the whole repository, not just download the Dockerfile

At first I tried with ./gradlew with the same result.

Okay, thanks for the hint with using the whole repository. I will try this.

jmizv commented 5 months ago

I gave this another try.

I've cloned the whole repository and followed the steps mentioned in the README.md. After building the Docker image from scratch and downloading some segment files I tried to start the brouter container but it failed with the following problem:

brouter$ docker run --rm -v ./misc/scripts/segments4:/segments4 brouter
ls: cannot access '../../../brouter-server/build/libs/brouter-*-all.jar': No such file or directory
Error: Could not find or load main class ......segments4
Caused by: java.lang.ClassNotFoundException: //////segments4

What am I doing wrong? :thinking:

jmizv commented 5 months ago

Seems to work now, sorry, for the inconvenience. I've just rebuild it...