├── Dockerfile ├── LICENSE └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster-slim AS rdkit-build-env 2 | 3 | RUN apt-get update \ 4 | && apt-get install -yq --no-install-recommends \ 5 | ca-certificates \ 6 | build-essential \ 7 | cmake \ 8 | wget \ 9 | libboost-dev \ 10 | libboost-iostreams-dev \ 11 | libboost-python-dev \ 12 | libboost-regex-dev \ 13 | libboost-serialization-dev \ 14 | libboost-system-dev \ 15 | libboost-thread-dev \ 16 | libcairo2-dev \ 17 | libeigen3-dev \ 18 | python3-dev \ 19 | python3-numpy \ 20 | && apt-get clean \ 21 | && rm -rf /var/lib/apt/lists/* 22 | 23 | ARG RDKIT_VERSION=Release_2020_03_2 24 | RUN wget --quiet https://github.com/rdkit/rdkit/archive/${RDKIT_VERSION}.tar.gz \ 25 | && tar -xzf ${RDKIT_VERSION}.tar.gz \ 26 | && mv rdkit-${RDKIT_VERSION} rdkit \ 27 | && rm ${RDKIT_VERSION}.tar.gz 28 | 29 | RUN mkdir /rdkit/build 30 | WORKDIR /rdkit/build 31 | 32 | RUN cmake -Wno-dev \ 33 | -D CMAKE_BUILD_TYPE=Release \ 34 | -D CMAKE_INSTALL_PREFIX=/usr \ 35 | -D Boost_NO_BOOST_CMAKE=ON \ 36 | -D PYTHON_EXECUTABLE=/usr/bin/python3 \ 37 | -D RDK_BUILD_AVALON_SUPPORT=ON \ 38 | -D RDK_BUILD_CAIRO_SUPPORT=ON \ 39 | -D RDK_BUILD_CPP_TESTS=OFF \ 40 | -D RDK_BUILD_INCHI_SUPPORT=ON \ 41 | -D RDK_BUILD_FREESASA_SUPPORT=ON \ 42 | -D RDK_INSTALL_INTREE=OFF \ 43 | -D RDK_INSTALL_STATIC_LIBS=OFF \ 44 | .. 45 | 46 | RUN make -j $(nproc) \ 47 | && make install 48 | 49 | FROM debian:buster-slim AS rdkit-env 50 | 51 | # Install runtime dependencies 52 | RUN apt-get update \ 53 | && apt-get install -yq --no-install-recommends \ 54 | libboost-atomic1.67.0 \ 55 | libboost-chrono1.67.0 \ 56 | libboost-date-time1.67.0 \ 57 | libboost-iostreams1.67.0 \ 58 | libboost-python1.67.0 \ 59 | libboost-regex1.67.0 \ 60 | libboost-serialization1.67.0 \ 61 | libboost-system1.67.0 \ 62 | libboost-thread1.67.0 \ 63 | libcairo2-dev \ 64 | python3-dev \ 65 | python3-numpy \ 66 | python3-cairo \ 67 | && apt-get clean \ 68 | && rm -rf /var/lib/apt/lists/* 69 | 70 | # Copy rdkit installation from rdkit-build-env 71 | COPY --from=rdkit-build-env /usr/lib/libRDKit* /usr/lib/ 72 | COPY --from=rdkit-build-env /usr/lib/cmake/rdkit/* /usr/lib/cmake/rdkit/ 73 | COPY --from=rdkit-build-env /usr/share/RDKit /usr/share/RDKit 74 | COPY --from=rdkit-build-env /usr/include/rdkit /usr/include/rdkit 75 | COPY --from=rdkit-build-env /usr/lib/python3/dist-packages/rdkit /usr/lib/python3/dist-packages/rdkit 76 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2018 Matt Swain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RDKit Docker Image 2 | 3 | [RDKit](https://github.com/rdkit/rdkit) is a collection of cheminformatics and machine-learning software written in C++ and Python. 4 | 5 | This Docker image provides a Debian distribution with Python 3 and all other dependencies installed via the Debian package manager. RDKit is compiled from source. 6 | 7 | This Docker image is designed to provide a lightweight RDKit installation, without any unnecessary build tools or package management infrastructure in the final image. Other images may inherit from it, or use it as an earlier stage in a multi-stage build process. See the [mcs07/postgres-rdkit](https://github.com/mcs07/docker-postgres-rdkit) image for an example of this. 8 | 9 | For a more complete environment that is easier to work with but results in a larger image, you may be better served by using a [miniconda](https://hub.docker.com/r/continuumio/miniconda3/) image and using `conda install` to add RDKit and other dependencies. 10 | 11 | ## Running 12 | 13 | Run `rdkit` container with an interactive shell: 14 | 15 | docker run -it --rm mcs07/rdkit:latest /bin/bash 16 | 17 | Or a python interpreter: 18 | 19 | docker run -it --rm mcs07/rdkit:latest python3 20 | 21 | ## Building 22 | 23 | A multi-stage docker build is used to produce a lightweight production image without all the build dependencies. To build, run: 24 | 25 | docker build -t rdkit . 26 | 27 | ## Related Projects 28 | 29 | - https://github.com/InformaticsMatters/docker-rdkit 30 | --------------------------------------------------------------------------------