Skip to content

Commit

Permalink
Multistage Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfr committed May 23, 2017
1 parent e74c8a7 commit 9ec444c
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
FROM python:2.7-alpine
FROM alpine as build

RUN apk add --no-cache build-base curl

COPY dcmtk.patch /tmp
RUN cd /tmp \
&& curl http://support.dcmtk.org/redmine/attachments/download/87/dcmtk-3.6.1_20150924.tar.gz | tar xz \
&& cd dcmtk-* \
&& patch -p1 </tmp/dcmtk.patch \
&& ./configure \
&& make config-all ofstd-all oflog-all dcmdata-all dcmimgle-all dcmimage-all dcmjpeg-all dcmjpls-all dcmtls-all dcmnet-all \
&& make dcmdata-install dcmnet-install \
&& rm -rf /tmp/dcmtk*
WORKDIR dcmtk
RUN curl http://support.dcmtk.org/redmine/attachments/download/87/dcmtk-3.6.1_20150924.tar.gz | tar xz --strip-components 1

COPY dcmtk.patch .
RUN patch -p1 <dcmtk.patch

RUN ./configure
RUN make config-all ofstd-all oflog-all dcmdata-all dcmimgle-all dcmimage-all dcmjpeg-all dcmjpls-all dcmtls-all dcmnet-all
RUN make dcmdata-install dcmnet-install



FROM python:2.7-alpine

RUN apk add --no-cache libstdc++

COPY --from=build /usr/local/bin /usr/local/bin
COPY --from=build /usr/local/etc/dcmtk /usr/local/etc/dcmtk
COPY --from=build /usr/local/share/dcmtk /usr/local/share/dcmtk
COPY --from=build /usr/local/share/doc/dcmtk /usr/local/share/doc/dcmtk

COPY . /src/reaper

Expand Down

0 comments on commit 9ec444c

Please sign in to comment.