1 # Provide an easy-to-reproduce environment in which to test full Python functionality.
2 # Produce an image with GROMACS installed. Use the root of the repository as the build context
4 # Optionally, set `--build-arg DOCKER_CORES=N` for a Docker engine running with access to more than 1 CPU.
5 # REF=`git show -s --pretty=format:"%h"`
6 # docker build -t gmxapi/gromacs-${MPIFLAVOR}:${REF} \
7 # --build-arg DOCKER_CORES=4 \
8 # --build-arg MPIFLAVOR=${MPIFLAVOR} \
9 # -f gromacs.dockerfile ../..
11 # This image serves as a base for integration with the gmxapi Python tools and sample code.
15 FROM gmxapi/gromacs-dependencies-$MPIFLAVOR:$REF as build
17 ENV SRC_DIR /tmp/gromacs-source
20 ENV BUILD_DIR /tmp/gromacs-build
21 RUN mkdir -p $BUILD_DIR
25 # Allow the build type to be specified with `docker build --build-arg TYPE=something`
28 -DCMAKE_INSTALL_PREFIX=/usr/local/gromacs \
31 -DGMX_BUILD_HELP=OFF \
32 -DGMX_USE_RDTSCP=OFF \
33 -DGMX_REQUIRE_VALID_TOOLCHAIN=TRUE \
34 -DGMX_INSTALL_LEGACY_API=ON \
35 -DCMAKE_BUILD_TYPE=$TYPE
36 RUN make -j$DOCKER_CORES
37 RUN make -j$DOCKER_CORES tests
38 RUN make -j$DOCKER_CORES install
40 FROM gmxapi/gromacs-dependencies-$MPIFLAVOR:$REF
42 COPY --from=build /usr/local/gromacs /usr/local/gromacs