moustakas / legacyhalos

Code and papers for a multi-faceted study of the baryonic content of dark matter halos in Legacy Survey imaging.
MIT License
4 stars 7 forks source link

some notes on improving the Docker file #111

Closed moustakas closed 4 years ago

moustakas commented 4 years ago

Getting a (minimal) conda installation for installing python dependencies--

FROM registry.services.nersc.gov/nersc/intel_cxx_fort_mpi_mkl_devel as builder

RUN wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh && \
bash miniconda.sh -b -p /opt/conda && \
conda config --add channels intel && \
conda config --set always_yes yes && \
conda update conda && \
conda install python=3.6 <other-packages> && \
conda clean -a -y

RUN <other work>

FROM registry.services.nersc.gov/nersc/intel_cxx_fort_mpi_mkl_runtime

COPY --from=builder /opt/conda /opt/conda

RUN echo 'PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
echo 'export PATH' >> /etc/profile.d/conda.sh
moustakas commented 4 years ago

The current Docker container builds on the legacypipe container, which itself uses the trick documented in this ticket to create a conda environment.