Merge pull request #25 from IsraelHikingMap/zstadler-build
Allow local image build
هذا الالتزام موجود في:
15
.github/build-and-upload.sh
مباع
15
.github/build-and-upload.sh
مباع
@@ -2,30 +2,19 @@
|
||||
|
||||
echo "Cloning graphhopper"
|
||||
git clone https://github.com/graphhopper/graphhopper.git
|
||||
cd graphhopper
|
||||
echo "Downloading Dockerfile and graphhopper.sh"
|
||||
curl -L https://raw.githubusercontent.com/IsraelHikingMap/graphhopper-docker-image-push/main/Dockerfile > Dockerfile
|
||||
curl -L https://raw.githubusercontent.com/IsraelHikingMap/graphhopper-docker-image-push/main/graphhopper.sh > graphhopper.sh
|
||||
chmod +x ./graphhopper.sh
|
||||
echo "Building docker image"
|
||||
docker build . -t israelhikingmap/graphhopper:latest
|
||||
docker login --username $DOCKERHUB_USER --password $DOCKERHUB_TOKEN
|
||||
echo "Publishing docker image"
|
||||
docker push israelhikingmap/graphhopper:latest
|
||||
|
||||
TAG=`git for-each-ref --sort=committerdate refs/tags | tail -n 1 | cut -d "/" -f3`
|
||||
TAG=`cd graphhopper; git for-each-ref --sort=committerdate refs/tags | tail -n 1 | cut -d "/" -f3`
|
||||
if docker manifest inspect israelhikingmap/graphhopper:$TAG >/dev/null; then
|
||||
echo "No need to publish existing version: $TAG";
|
||||
else
|
||||
mv Dockerfile ../Dockerfile
|
||||
mv graphhopper.sh ../graphhopper.sh
|
||||
git checkout tags/$TAG
|
||||
mv ../Dockerfile Dockerfile
|
||||
mv ../graphhopper.sh graphhopper.sh
|
||||
(cd graphhopper ; git checkout tags/$TAG)
|
||||
echo "Building docker image for tag: $TAG"
|
||||
docker build . -t israelhikingmap/graphhopper:$TAG
|
||||
echo "Publishing docker image for tag: $TAG"
|
||||
docker push israelhikingmap/graphhopper:$TAG
|
||||
fi
|
||||
|
||||
|
||||
|
||||
10
Dockerfile
10
Dockerfile
@@ -1,10 +1,8 @@
|
||||
FROM maven:3.6.3-jdk-8 as build
|
||||
|
||||
RUN apt-get install -y wget
|
||||
|
||||
WORKDIR /graphhopper
|
||||
|
||||
COPY . .
|
||||
COPY graphhopper .
|
||||
|
||||
RUN mvn clean install
|
||||
|
||||
@@ -16,11 +14,9 @@ RUN mkdir -p /data
|
||||
|
||||
WORKDIR /graphhopper
|
||||
|
||||
COPY --from=build /graphhopper/web/target/graphhopper*.jar ./
|
||||
COPY --from=build /graphhopper/web/target/graphhopper*.jar .
|
||||
|
||||
COPY ./config-example.yml ./
|
||||
|
||||
COPY ./graphhopper.sh ./
|
||||
COPY graphhopper.sh graphhopper/config-example.yml .
|
||||
|
||||
VOLUME [ "/data" ]
|
||||
|
||||
|
||||
@@ -32,3 +32,5 @@ docker run --entrypoint /bin/bash israelhikingmap/graphhopper -c "wget https://d
|
||||
```
|
||||
|
||||
Checkout `graphhopper.sh` for more usage options such as import.
|
||||
|
||||
In order to build the docker image locally, please run [`.github/build.sh`](.github/build.sh).
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم