anaconda / docker-images

Repository of Docker images created by Anaconda
https://hub.docker.com/u/continuumio/
834 stars 282 forks source link

Conda enviroment in docker #133

Open AmmarOkran opened 5 years ago

AmmarOkran commented 5 years ago

I successfully have built a docker image with ContinuumIO with the following Dockerfile:

FROM continuumio/miniconda3:4.5.4

ENV FLASK_PROXY_PORT 8080

RUN apt-get update && apt-get install -y \
        gcc \
        libc-dev \
        libxslt-dev \
        libxml2-dev \
        libffi-dev \
        libssl-dev \
        zip \
        unzip \
        vim \
        && rm -rf /var/lib/apt/lists/*

RUN apt-cache search linux-headers-generic

RUN conda install -c conda-forge pdal python-pdal  gdal && conda clean --all

COPY requirements.txt requirements.txt

RUN pip install --upgrade pip setuptools six && pip install --no-cache-dir -r requirements.txt

# create action working directory

RUN mkdir -p /action

RUN mkdir -p /actionProxy

ADD https://raw.githubusercontent.com/apache/incubator-openwhisk-runtime-docker/8b2e205c39d84ed5ede6b1b08cccf314a2b13105/core/actionProxy/actionproxy.py /actionProxy/actionproxy.py

RUN mkdir -p /pythonAction

ADD https://raw.githubusercontent.com/apache/incubator-openwhisk-runtime-python/3%401.0.3/core/pythonAction/pythonrunner.py /pythonAction/pythonrunner.py

ENV PATH /opt/conda/share/proj:$PATH

CMD ["/bin/bash", "-c", "cd /pythonAction && python -u pythonrunner.py"]

However, I got some problems with apply some filters of PDAL libary with this errors:

stderr: proj_create_from_database: Open of /opt/conda/share/proj failed"

Then I tried to create an environment with conda but I couldn't activate it with docker, any suggestion? How can I create an environment and activate it with this docker file?

GeeCastro commented 5 years ago

https://fmgdata.kinja.com/using-docker-with-conda-environments-1790901398 This article (although a bit old) mentions the fact that anaconda doesnt use env in the images. Try applying similar approach. I hope this helps

sorenwacker commented 2 years ago

There is no content any more.