Skip to content

Instantly share code, notes, and snippets.

@samuelstanton
Created December 29, 2020 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuelstanton/65a0a6855d6f3c4943164968c1310132 to your computer and use it in GitHub Desktop.
Save samuelstanton/65a0a6855d6f3c4943164968c1310132 to your computer and use it in GitHub Desktop.
How to install conda in a docker container
FROM nvidia/cuda:11.0-cudnn8-devel-ubuntu18.04
RUN apt-get update --fix-missing && \
apt-get install -y wget bzip2 ca-certificates curl git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/bin/bash ~/miniconda.sh -b -p /opt/conda && \
rm ~/miniconda.sh && \
/opt/conda/bin/conda clean -tipsy && \
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
ENV PATH /opt/conda/bin:$PATH
ENV LD_LIBRARY_PATH /usr/local/cuda-11.0/lib64:/usr/local/cuda-11.0/extras/CUPTI/lib64:$LD_LIBRARY_PATH
RUN conda create --name my_env python=3.8 && \
echo "conda activate my_env" >> ~/.bashrc
SHELL ["/bin/bash", "--login", "-c"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment