2021-11-18 02:39:38 +08:00
|
|
|
FROM ubuntu:focal AS build
|
2021-11-16 01:23:44 +08:00
|
|
|
|
|
|
|
# Set timezone:
|
|
|
|
RUN ln -snf /usr/share/zoneinfo/$CONTAINER_TIMEZONE /etc/localtime && echo $CONTAINER_TIMEZONE > /etc/timezone
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y \
|
|
|
|
build-essential \
|
|
|
|
cmake \
|
|
|
|
git \
|
|
|
|
libnvtt-dev
|
|
|
|
|
2021-11-18 02:39:38 +08:00
|
|
|
RUN useradd --create-home --home-dir=/home/flightgear --shell=/bin/false flightgear
|
|
|
|
USER flightgear
|
|
|
|
|
|
|
|
WORKDIR /home/flightgear/build/
|
|
|
|
ARG INSTALLPREFIX=/home/flightgear/dist
|
|
|
|
|
2021-11-16 01:23:44 +08:00
|
|
|
RUN git clone --branch release/2.4 https://github.com/OSGeo/gdal.git
|
|
|
|
WORKDIR /home/flightgear/build/gdal/gdal
|
2021-11-18 02:39:38 +08:00
|
|
|
RUN ./configure --prefix=${INSTALLPREFIX}
|
2021-11-16 01:23:44 +08:00
|
|
|
RUN make -j $(nproc)
|
|
|
|
RUN make install
|
|
|
|
|
|
|
|
WORKDIR /home/flightgear/build/
|
|
|
|
RUN git clone --branch OpenSceneGraph-3.6.5 https://github.com/openscenegraph/OpenSceneGraph.git
|
|
|
|
RUN mkdir OpenSceneGraph/build/
|
2021-11-18 02:39:38 +08:00
|
|
|
USER root
|
2021-11-16 01:23:44 +08:00
|
|
|
RUN cat /etc/apt/sources.list
|
|
|
|
RUN sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list
|
|
|
|
RUN cat /etc/apt/sources.list
|
|
|
|
RUN apt-get update && apt-get build-dep -y openscenegraph
|
2021-11-18 02:39:38 +08:00
|
|
|
USER flightgear
|
2021-11-16 01:23:44 +08:00
|
|
|
WORKDIR OpenSceneGraph/build
|
2021-11-18 02:39:38 +08:00
|
|
|
RUN cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS_RELEASE="-O3 -pipe" -D CMAKE_C_FLAGS_RELEASE="-O3 -pipe" -D CMAKE_PREFIX_PATH:PATH=${INSTALLPREFIX} -D CMAKE_INSTALL_PREFIX:PATH=${INSTALLPREFIX} -D CMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOLEAN="true" -G "Unix Makefiles" ..
|
2021-11-16 01:23:44 +08:00
|
|
|
RUN make -j $(nproc)
|
|
|
|
RUN make install
|
|
|
|
|
|
|
|
WORKDIR /home/flightgear/build/
|
|
|
|
RUN git clone https://github.com/openscenegraph/VirtualPlanetBuilder.git && cd VirtualPlanetBuilder && git checkout VirtualPlanetBuilder-1.0
|
|
|
|
RUN mkdir VirtualPlanetBuilder/build/
|
|
|
|
WORKDIR /home/flightgear/build/VirtualPlanetBuilder/build/
|
2021-11-18 02:39:38 +08:00
|
|
|
RUN cmake -D CMAKE_PREFIX_PATH:PATH=${INSTALLPREFIX} -D CMAKE_INSTALL_PREFIX:PATH=${INSTALLPREFIX} ..
|
2021-11-16 01:23:44 +08:00
|
|
|
RUN make -j $(nproc)
|
|
|
|
RUN make install
|
|
|
|
|
2021-11-18 02:39:38 +08:00
|
|
|
FROM ubuntu:focal
|
|
|
|
LABEL maintainer="Fahim Dalvi"
|
|
|
|
LABEL version="1"
|
|
|
|
LABEL description="FlightGear WS30 VPB tools"
|
|
|
|
|
|
|
|
RUN true && \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y libgl1 libfontconfig libnvtt-dev libproj-dev && \
|
|
|
|
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
|
|
|
|
|
|
|
|
WORKDIR /home/flightgear
|
|
|
|
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/
|
|
|
|
|
|
|
|
USER flightgear
|
|
|
|
ENV LD_LIBRARY_PATH /usr/lib64:/usr/lib
|
|
|
|
ENV GDAL_DATA /usr/local/share
|
2021-11-16 01:23:44 +08:00
|
|
|
|
|
|
|
CMD ["/bin/bash"]
|