-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
74 lines (57 loc) · 2.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
MAINTAINER Michael Smith [[email protected]]
FROM continuumio/miniconda3 as build
RUN apt-get update --fix-missing && \
apt-get install -y \
wget unzip bzip2 ca-certificates sudo curl git \
vim parallel time && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
SHELL ["/bin/bash", "-c"]
ENV BASH_ENV ~/.bashrc
SHELL ["/bin/bash", "-c"]
ENV PATH /opt/conda/bin:$PATH
ARG PDAL_VERSION
ARG PYTHON_VERSION
# Create the environment:
RUN conda create --yes --quiet --name pdal python=${PYTHON_VERSION} && \
conda config --add channels conda-forge && \
conda install --yes boto3 conda-pack && \
conda update --all && \
conda install -n pdal --yes pdal=${PDAL_VERSION} && \
conda clean -afy
RUN conda-pack -n pdal -o /tmp/env.tar --ignore-missing-files && \
mkdir /venv && cd /venv && tar xf /tmp/env.tar && \
rm /tmp/env.tar
RUN /venv/bin/conda-unpack
FROM registry1.dso.mil/ironbank/opensource/python:v${PYTHON_VERSION} as runtime
USER root
RUN rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN dnf update -y \
&& dnf install -y \
wget curl less time unzip zip lsof time procps-ng binutils glibc vim-enhanced glibc-langpack-en \
&& dnf clean all
RUN echo 'LANG="en_US.utf8"' > /etc/locale.conf
RUN ln -s /usr/lib64/libnsl.so.2 /usr/lib64/libnsl.so.1
ENV CONDAENV /opt/conda/envs/pdal
COPY --from=build /venv ${CONDAENV}
# Hack to work around problems with Proj.4 in Docker
ENV PROJ_LIB ${CONDAENV}/share/proj
ENV PROJ_NETWORK=TRUE
ENV PATH $PATH:${CONDAENV}/bin
ENV DTED_APPLY_PIXEL_IS_POINT=TRUE
ENV GTIFF_POINT_GEO_IGNORE=TRUE
ENV GTIFF_REPORT_COMPD_CS=TRUE
ENV REPORT_COMPD_CS=TRUE
ENV OAMS_TRADITIONAL_GIS_ORDER=TRUE
ENV XDG_DATA_HOME=${CONDAENV}/share
ENV LD_LIBRARY_PATH=${CONDAENV}/x86_64-conda-linux-gnu/sysroot/usr/lib64:${CONDAENV}/lib
SHELL ["/bin/bash", "-c"]
RUN source ${CONDAENV}/bin/activate && projsync --source-id us_nga && projsync --source-id us_noaa
ARG GID
ARG UID
RUN groupadd --gid $GID pdalgroup
RUN useradd pdalusr --uid $UID --gid $GID
USER pdalusr
WORKDIR /u02
ENTRYPOINT source ${CONDAENV}/bin/activate && bash