From 4730d57d404ba24cf64f762e27b936ee2224182a Mon Sep 17 00:00:00 2001 From: Fahim Imaduddin Dalvi Date: Sat, 22 Jan 2022 17:18:23 +0300 Subject: [PATCH] WS30: Updated Dockerfile with python scripts The Dockerfile has been updated to include Python, ws30 line data generation scripts and their dependencies. --- ws30/ws30-vbp-generator-docker/.gitignore | 5 ++++- ws30/ws30-vbp-generator-docker/Dockerfile | 10 +++++++++- ws30/ws30-vbp-generator-docker/build_image.sh | 15 ++++++++++++++- ws30/ws30-vbp-generator-docker/run_image.sh | 2 +- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/ws30/ws30-vbp-generator-docker/.gitignore b/ws30/ws30-vbp-generator-docker/.gitignore index e6f9700..4c41ac7 100644 --- a/ws30/ws30-vbp-generator-docker/.gitignore +++ b/ws30/ws30-vbp-generator-docker/.gitignore @@ -13,4 +13,7 @@ data/readme.txt *.DS_Store # Output folder -output \ No newline at end of file +output + +# build dir +build \ No newline at end of file diff --git a/ws30/ws30-vbp-generator-docker/Dockerfile b/ws30/ws30-vbp-generator-docker/Dockerfile index 5c598e4..30838ae 100644 --- a/ws30/ws30-vbp-generator-docker/Dockerfile +++ b/ws30/ws30-vbp-generator-docker/Dockerfile @@ -44,6 +44,9 @@ RUN cmake -D CMAKE_PREFIX_PATH:PATH=${INSTALLPREFIX} -D CMAKE_INSTALL_PREFIX:PAT RUN make -j $(nproc) RUN make install +WORKDIR /home/flightgear/ +COPY build/fgmeta fgmeta + FROM ubuntu:focal LABEL maintainer="Fahim Dalvi" LABEL version="1" @@ -51,7 +54,7 @@ LABEL description="FlightGear WS30 VPB tools" RUN true && \ apt-get update && \ - apt-get install -y libgl1 libfontconfig libnvtt-dev libproj-dev && \ + apt-get install -y libgl1 libfontconfig libnvtt-dev libproj-dev python3 python3-pip && \ rm -rf /var/lib/apt/lists/* && \ groupadd --gid 1000 flightgear && useradd --uid 1000 --gid flightgear --create-home --home-dir=/home/flightgear --shell=/bin/bash flightgear @@ -60,8 +63,13 @@ COPY --from=build /home/flightgear/dist/bin/* /usr/local/bin/ COPY --from=build /home/flightgear/dist/share/* /usr/local/share/ COPY --from=build /home/flightgear/dist/lib/* /usr/lib/ COPY --from=build /home/flightgear/dist/lib64/* /usr/lib64/ +COPY --from=build /home/flightgear/fgmeta/ws30 /home/flightgear/scripts + +RUN ln -s /usr/bin/python3 /usr/bin/python USER flightgear +RUN pip install -r scripts/requirements.txt + ENV LD_LIBRARY_PATH /usr/lib64:/usr/lib ENV GDAL_DATA /usr/local/share diff --git a/ws30/ws30-vbp-generator-docker/build_image.sh b/ws30/ws30-vbp-generator-docker/build_image.sh index ded524e..fed9dd7 100755 --- a/ws30/ws30-vbp-generator-docker/build_image.sh +++ b/ws30/ws30-vbp-generator-docker/build_image.sh @@ -1,3 +1,16 @@ #!/bin/bash -docker build . -t flightgear/ws30-vbp-generator:v1 \ No newline at end of file +# Clone fgmeta +mkdir -p build +cd build +if [ -d "fgmeta" ]; then + cd fgmeta + git pull origin next + cd .. +else + git clone --branch next https://git.code.sf.net/p/flightgear/fgmeta fgmeta +fi +cd .. + +# Build docker image +docker build . -t flightgear/ws30-vbp-generator:v1.1 \ No newline at end of file diff --git a/ws30/ws30-vbp-generator-docker/run_image.sh b/ws30/ws30-vbp-generator-docker/run_image.sh index 7515562..816e1a2 100755 --- a/ws30/ws30-vbp-generator-docker/run_image.sh +++ b/ws30/ws30-vbp-generator-docker/run_image.sh @@ -8,4 +8,4 @@ docker run \ --mount "type=bind,source=`pwd`/data,target=${BASE_DIR}/data,readonly" \ --mount "type=bind,source=`pwd`/output,target=${BASE_DIR}/output" \ -it \ - flightgear/ws30-vbp-generator:v1 /bin/bash $1 \ No newline at end of file + flightgear/ws30-vbp-generator:latest /bin/bash $1 \ No newline at end of file