Closed lruizcalico closed 9 months ago
Instead of adding "myenv" to PATH
, shouldn't you add "polyfun"? That might remove the need to use conda run
ENV PATH /opt/conda/envs/polyfun/bin:$PATH
Ah that's a typo. However, it is still same when I changed it to polyfun. Even without a docker image, if I just run on a console (base) with conda run -n polyfun finemapper.py --n <num_samples>
it still would complain.
Some ideas to experiment with:
conda run
, you can remove the following two lines which attempt to activate the env:RUN echo "source activate polyfun" > ~/.bashrc
ENV PATH /opt/conda/envs/myenv/bin:$PATH
I like your idea of wrapping via bash -c
. This works for me: conda run -n polyfun bash -c "python finemapper.py --n 1"
As an alternative to conda run
, this blog post section demonstrates how to modify the entrypoint script to activate the conda env
This is a Dockerfile that worked for me, in case it is of interest to anyone
# Start from a base image that includes Python and R
FROM rocker/verse:4.1.3
# Install Python3 and pip
RUN apt-get -y update && \
apt-get -y upgrade && \
apt-get install -y python3-pip python3-dev
RUN apt-get install -y python3 python3-pip
# Update symlink to point to latest
RUN apt-get install -y git
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN git clone https://github.com/omerwe/polyfun
# Install Python dependencies
RUN python3 -m pip install --upgrade pip && \
python3 -m pip install numpy
RUN python3 -m pip install rpy2 scipy scikit-learn pandas tqdm pyarrow bitarray pandas-plink
# Install R dependencies
RUN R -e "install.packages('remotes', repos='http://cran.rstudio.com/')"
# Install a specific version of susieR
RUN R -e "remotes::install_version('susieR', version='0.11.92', repos='http://cran.rstudio.com/')"
CMD ["/bin/bash"]
I ended up not using conda. It seems to be able to run finemapper.py just fine
Hi, I created a docker image to run finemapper.py. The dockerfile is like this:
finemapper.py has a
--n
flag, which then confused theconda run -n
and resulted in this error:conda run: error: ambiguous option: --n could match --name, --no-capture-output
I changed the--n
flag into--num_samples
flag inside finemapper.py and it ran okay afterward. I was wondering if you could add this as an option instead of--n
which can be confusing toconda run
. Thank you.