Skip to content

Commit

Permalink
Fix up docker configuration issues #3375
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Mar 31, 2021
1 parent 368f066 commit f045dff
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 88 deletions.
32 changes: 9 additions & 23 deletions scripts/docker/ubuntu/Dockerfile
@@ -1,17 +1,14 @@
FROM pdal/ubuntubase:latest as builder
MAINTAINER Andrew Bell <andrew@hobu.co>

SHELL ["/bin/bash", "-c"]
SHELL ["conda", "run", "-n", "pdal", "/bin/bash", "-c"]

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
git clone http://github.com/PDAL/PDAL.git pdal

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
RUN git clone http://github.com/PDAL/PDAL.git pdal && \
mkdir -p pdal/build && \
cd pdal/build && \
cmake -G Ninja \
LDFLAGS="-Wl,-rpath-link,$CONDA_PREFIX/lib" cmake -G Ninja \
-DCMAKE_LIBRARY_PATH:FILEPATH="$CONDA_PREFIX/lib" \
-DCMAKE_INCLUDE_PATH:FILEPATH="$CONDA_PREFIX/include" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_PLUGIN_CPD=OFF \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
Expand All @@ -26,27 +23,16 @@ RUN . /opt/conda/etc/profile.d/conda.sh && \
-DWITH_LASZIP=ON \
..

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
cd pdal/build && \
RUN cd pdal/build && \
ninja

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
cd pdal/build && \
RUN cd pdal/build && \
ctest -V

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
cd pdal/build && \
RUN cd pdal/build && \
ninja install

RUN apt-get -y remove unzip bzip2 gcc g++ ca-certificates && \
apt-get -y autoremove

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
conda remove -c conda-forge git cmake ninja conda-forge-ci-setup
RUN conda remove -c conda-forge git cmake ninja conda-forge-ci-setup

RUN rm /opt/conda/envs/pdal/lib/*.a && \
rm /opt/conda/envs/pdal/include/H5*.h && \
Expand Down
103 changes: 38 additions & 65 deletions scripts/docker/ubuntu/Dockerfile.dependencies
@@ -1,74 +1,47 @@
FROM ubuntu:bionic
FROM debian:buster-slim
MAINTAINER Andrew Bell<andrew@hobu.co>

SHELL ["/bin/bash", "-c"]
ENV CC gcc-6
ENV CXX g++-6

RUN apt-get update --fix-missing && \
apt-get install -y \
wget unzip bzip2 gcc-6 g++-6 ca-certificates curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda update -n base -c defaults conda && \
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8

RUN apt-get update -q && \
apt-get install -q -y \
bzip2 \
ca-certificates \
git \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
mercurial \
subversion \
wget \
&& apt-get clean

ENV PATH /opt/conda/bin:$PATH

CMD [ "/bin/bash" ]

# Leave these args here to better use the Docker build cache
ARG CONDA_VERSION=py38_4.9.2
ARG CONDA_MD5=122c8c9beb51e124ab32a0fa6426c656

RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh -O miniconda.sh && \
echo "${CONDA_MD5} miniconda.sh" > miniconda.md5 && \
if ! md5sum --status -c miniconda.md5; then exit 1; fi && \
mkdir -p /opt && \
sh miniconda.sh -b -p /opt/conda && \
rm miniconda.sh miniconda.md5 && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.profile && \
echo "conda activate base" >> ~/.profile
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
echo "conda activate base" >> ~/.bashrc && \
find /opt/conda/ -follow -type f -name '*.a' -delete && \
find /opt/conda/ -follow -type f -name '*.js.map' -delete && \
/opt/conda/bin/conda clean -afy

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda create --yes --quiet --name pdal && \
conda activate pdal && \
conda install --yes --name pdal -c conda-forge git cmake ninja \
conda-forge-ci-setup && \
conda install --yes --name pdal -c conda-forge pdal --only-deps

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
conda install --yes --name pdal -c conda-forge eigen

#
# We install fgt and cpd in /usr. By default they'll go in /usr/local.
# When in /usr/local, we'd have to run ldconfig in order for them to be found
# at run-time. This is an issue for the CPD filter and test. We could also
# put them in the conda directory and set the rpath when building the
# test. Probably better is just to stick this stuff in vendor and build
# as a static lib(s).
#
RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
git clone https://github.com/PDAL/fgt.git && \
mkdir -p fgt/build && \
cd fgt/build && \
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-G Ninja .. && \
ninja install && \
cd / && \
rm -rf fgt

RUN . /opt/conda/etc/profile.d/conda.sh && \
conda activate pdal && \
git clone https://github.com/PDAL/cpd.git && \
mkdir -p cpd/build && \
cd cpd/build && \
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_FGT=ON \
-G Ninja .. && \
ninja install && \
cd / && \
rm -rf cpd
RUN conda create -n pdal -y && conda install -c conda-forge compilers git cmake ninja && \
conda install --yes --name pdal -c conda-forge pdal --only-deps

RUN \
mkdir gridzip && \
cd gridzip && \
curl -LOs http://download.osgeo.org/proj/proj-datumgrid-1.8.zip && unzip -j -u -o proj-datumgrid-1.8.zip -d /usr/share/proj && rm proj-datumgrid-1.8.zip ; \
curl -LOs http://download.osgeo.org/proj/proj-datumgrid-europe-1.2.zip && unzip -j -u -o proj-datumgrid-europe-1.2.zip -d /usr/share/proj && rm proj-datumgrid-europe-1.2.zip ; \
curl -LOs http://download.osgeo.org/proj/proj-datumgrid-oceania-1.0.zip && unzip -j -u -o proj-datumgrid-oceania-1.0.zip -d /usr/share/proj && rm proj-datumgrid-oceania-1.0.zip; \
curl -LOs http://download.osgeo.org/proj/proj-datumgrid-world-1.0.zip && unzip -j -u -o proj-datumgrid-world-1.0.zip -d /usr/share/proj && rm proj-datumgrid-world-1.0.zip; \
curl -LOs http://download.osgeo.org/proj/proj-datumgrid-north-america-1.2.zip && unzip -j -u -o proj-datumgrid-north-america-1.2.zip -d /usr/share/proj && rm proj-datumgrid-north-america-1.2.zip

0 comments on commit f045dff

Please sign in to comment.