Last active
August 12, 2019 14:08
-
-
Save heiner/6c644960c09cca7c21ae71465989d86b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
SHELL ["/bin/bash", "-c"] | |
RUN apt-get update && apt-get install -y \ | |
python3-setuptools \ | |
python3-pip \ | |
git \ | |
libsm6 \ | |
libxext6 \ | |
libxrender-dev \ | |
wget | |
WORKDIR /src | |
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh | |
RUN bash Miniconda3-latest-Linux-x86_64.sh -b | |
ENV PATH /root/miniconda3/bin:$PATH | |
ENV CONDA_PREFIX /root/miniconda3/envs/tensorbug | |
# Clear .bashrc (it refuses to run non-interactively otherwise) | |
RUN echo > ~/.bashrc | |
# Add conda logic to .bashrc | |
RUN conda init bash | |
RUN conda create -y -n tensorbug python=3.7 \ | |
numpy \ | |
pytorch \ | |
torchvision | |
# Activate environment in .bashrc | |
RUN echo "conda activate tensorbug" >> /root/.bashrc | |
# Make bash excecute .bashrc even when running non-interactively. | |
ENV BASH_ENV /root/.bashrc | |
RUN git clone https://gist.github.com/c03aa5df92408974922aea7ec499405c.git catbug | |
WORKDIR /src/catbug | |
RUN python3 setup.py build develop | |
CMD ["bash", "-c", "python3 run.py"] | |
# Docker commands: | |
# docker rm catbug -v | |
# docker build -t catbug . | |
# docker run --name catbug catbug | |
# or | |
# docker run --name catbug -it catbug /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
SHELL ["/bin/bash", "-c"] | |
RUN apt-get update && apt-get install -y \ | |
python3-setuptools \ | |
python3-pip \ | |
git \ | |
libsm6 \ | |
libxext6 \ | |
libxrender-dev \ | |
wget | |
# Install PyTorch. This needs increased Docker memory. | |
# (https://github.com/pytorch/pytorch/issues/1022) | |
RUN pip3 download torch | |
RUN pip3 install torch*.whl | |
WORKDIR /src | |
RUN git clone https://gist.github.com/c03aa5df92408974922aea7ec499405c.git catbug | |
WORKDIR /src/catbug | |
RUN python3 setup.py build develop | |
CMD ["python3", "run.py"] | |
# Docker commands: | |
# docker rm catbug -v | |
# docker build -t catbug . | |
# docker run --name catbug catbug | |
# or | |
# docker run --name catbug -it catbug /bin/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment