Skip to content

Commit

Permalink
Merge pull request #1665 from ANTsX/docker_static
Browse files Browse the repository at this point in the history
ENH: Allow static libs, re-enable testing
  • Loading branch information
cookpa authored Jan 24, 2024
2 parents 2d4c931 + ce3fb18 commit d5aba86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 0 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ bin
build
*.orig
*.bak

.git
Dockerfile
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,37 @@ RUN git config --global url.'https://'.insteadOf 'git://'
COPY . /usr/local/src/ants
WORKDIR /build

ARG CC=gcc-11 CXX=g++-11
ARG CC=gcc-11 CXX=g++-11 BUILD_SHARED_LIBS=ON

RUN cmake \
-GNinja \
-DBUILD_TESTING=ON \
-DRUN_LONG_TESTS=OFF \
-DRUN_SHORT_TESTS=ON \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} \
-DCMAKE_INSTALL_PREFIX=/opt/ants \
/usr/local/src/ants
RUN cmake --build . --parallel
WORKDIR /build/ANTS-build
RUN cmake --install .

ENV PATH="/opt/ants/bin:$PATH" \
LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH"

RUN cmake --build . --target test

FROM base

RUN apt-get update \
&& apt-get install -y --no-install-recommends bc \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

COPY --from=builder /opt/ants /opt/ants
ENV PATH="/opt/ants/bin:$PATH" \
LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH"

COPY --from=builder /opt/ants /opt/ants

LABEL org.opencontainers.image.authors="ANTsX team" \
org.opencontainers.image.url="https://stnava.github.io/ANTs/" \
org.opencontainers.image.source="https://github.com/ANTsX/ANTs" \
Expand Down

0 comments on commit d5aba86

Please sign in to comment.