0% found this document useful (0 votes)
5 views1 page

Dockerfile for Chemprop Setup

This Dockerfile creates a Docker image for Chemprop with necessary dependencies, specifically designed for CPU use. It includes instructions for building the image and running it in an interactive terminal. The image is based on a Miniconda3 parent image and sets up a conda environment with Python 3.11 and required packages.

Uploaded by

Mohsin Md
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Dockerfile for Chemprop Setup

This Dockerfile creates a Docker image for Chemprop with necessary dependencies, specifically designed for CPU use. It includes instructions for building the image and running it in an interactive terminal. The image is based on a Miniconda3 parent image and sets up a conda environment with Python 3.11 and required packages.

Uploaded by

Mohsin Md
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

# Dockerfile

#
# Builds a Docker image containing Chemprop and its required dependencies.
#
# Build this image with:
# git clone [Link]
# cd chemprop
# docker build --tag=chemprop:latest .
#
# Run the built image with:
# docker run --name chemprop_container -it chemprop:latest
#
# Note:
# This image only runs on CPU - we do not provide a Dockerfile
# for GPU use (see installation documentation).

# Parent Image
FROM continuumio/miniconda3:latest

# Install libxrender1 (required by RDKit) and then clean up


RUN apt-get update && \
apt-get install -y \
libxrender1 && \
apt-get autoremove -y && \
apt-get clean -y

WORKDIR /opt/chemprop

# build an empty conda environment with appropriate Python version


RUN conda create --name chemprop_env python=3.11*

# This runs all subsequent commands inside the chemprop_env conda environment
#
# Analogous to just activating the environment, which we can't actually do here
# since that requires running conda init and restarting the shell (not possible
# in a Dockerfile build script)
SHELL ["conda", "run", "--no-capture-output", "-n", "chemprop_env", "/bin/bash", "-
c"]

# Follow the installation instructions then clear the cache


ADD chemprop chemprop
ENV PYTHONPATH /opt/chemprop
ADD [Link] [Link] [Link] ./
RUN conda install pytorch cpuonly -c pytorch && \
conda clean --all --yes && \
python -m pip install . && \
python -m pip cache purge

# when running this image, open an interactive bash terminal inside the conda
environment
RUN echo "conda activate chemprop_env" > ~/.bashrc
ENTRYPOINT ["/bin/bash", "--login"]

You might also like