Open Cinerar opened 6 years ago
Yeah probably a problem. To fix this particular issue, from e.g. https://github.com/ContinuumIO/docker-images/blob/master/anaconda3/Dockerfile#L11
we should change
RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh
to
RUN wget --quiet https://repo.continuum.io/archive/Anaconda3-5.1.0-Linux-x86_64.sh -O ~/anaconda.sh && \
/bin/bash ~/anaconda.sh -b -p /opt/conda && \
rm ~/anaconda.sh && \
ln -s /opt/anaconda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
For Miniconda3 4.4.10, I still receive the same error despite the changes.
Update: interestingly, it was fixed by removing RUN conda activate base
from my Dockerfile.
Adding echo "conda activate base" >> ~/.bashrc
can be problematic if PATH is configured to point to particular conda env. Now anytime you try to get a bash shell, it will switch to base env which perhaps someone does not expect.
Is this a desirable change? Could this issue have been fixed without forcing base env? I imagine this might trick others as well
I ended up using the frolvlad/alpine-miniconda3
image and using the source activate <name>
command in it. This is how I used it in CircleCI:
version: 2
jobs:
conda:
docker:
- image: frolvlad/alpine-miniconda3
steps:
# gcc for numba install
- run: apk add --no-cache build-base ca-certificates git openssh
- checkout
- restore_cache:
keys:
- conda-pkgs
- run: conda env create
- save_cache:
key: conda-pkgs
paths:
- /opt/conda/pkgs
- run: source activate numba-xnd && cd numba && python setup.py develop
- run: source activate numba-xnd && python -m unittest
workflows:
version: 2
test:
jobs:
- conda
I do:
docker run -i -t continuumio/anaconda3 /bin/bash
Then i try to activate any env (for ex base) withconda activate base
i recieveI believe this is related with the change in recomended way to enable conda in shell https://github.com/conda/conda/releases/tag/4.4.0
more specifically this is the line that creates this problem https://github.com/ContinuumIO/docker-images/blob/13044336262c9401e35cd490c5545656d3241b2c/anaconda3/Dockerfile#L11
unfortunatelly i can't figure out how to fix it.