Skip to content

Commit

Permalink
build: improve dockerfile step
Browse files Browse the repository at this point in the history
change multi line of apt install to one line
  • Loading branch information
Chinlinlee committed Nov 21, 2021
1 parent 920410e commit 3e1022c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 25 deletions.
42 changes: 20 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
FROM node:14-bullseye-slim
# install gcc
RUN apt update -y
RUN apt install -y gcc
RUN apt update -y && apt install -y gcc


#install python
RUN apt-get update -y && apt-get install python -y
RUN apt-get install python3-pip -y
RUN pip3 install --upgrade pip
RUN pip3 install pydicom opencv-python Pillow flask matplotlib highdicom
RUN apt-get install python python3-pip -y && \
pip3 install --upgrade pip && pip3 install pydicom opencv-python Pillow flask matplotlib highdicom

RUN apt-get install software-properties-common -y
RUN apt-get update -y
RUN apt-get install 'ffmpeg'\
#install other dependencies, dcmtk, cmake, netcat, imagemagick etc.
RUN apt-get install software-properties-common -y && \
apt-get update -y && \
apt-get install 'ffmpeg'\
'libsm6'\
'libxext6' -y
RUN apt-get update && apt-get install -y dcmtk \
cmake \
make \
swig \
netcat \
imagemagick \
wget
'libxext6' \
dcmtk \
cmake \
make \
swig \
netcat \
imagemagick \
wget -y

#Build gdcm
RUN wget -O gdcm.tar.gz https://sourceforge.net/projects/gdcm/files/gdcm%202.x/GDCM%202.8.9/gdcm-2.8.9.tar.gz
RUN tar xzvf gdcm.tar.gz
RUN cd /
RUN wget -O gdcm.tar.gz https://sourceforge.net/projects/gdcm/files/gdcm%202.x/GDCM%202.8.9/gdcm-2.8.9.tar.gz && tar xzvf gdcm.tar.gz
RUN mkdir gdcm-build
WORKDIR /gdcm-build
RUN cmake ../gdcm-2.8.9 -DGDCM_BUILD_SHARED_LIBS=ON -DGDCM_WRAP_PYTHON=ON -DGDCM_DOCUMENTATION=OFF -DGDCM_BUILD_EXAMPLES=OFF -DGDCM_BUILD_TESTING=OFF ; exit 0
RUN make -j8 && make install
WORKDIR /gdcm-build/bin
RUN cp gdcm.py gdcmswig.py _gdcmswig.so /usr/local/lib/python3.9/dist-packages
RUN rm -rf /gdcm.tar.gz

# Build iconv
WORKDIR /
RUN wget -O libiconv.tar.gz https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
RUN tar xzvf libiconv.tar.gz
RUN wget -O libiconv.tar.gz https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz && tar xzvf libiconv.tar.gz
WORKDIR /libiconv-1.16
RUN ./configure
RUN make && make install
RUN rm -rf /libiconv.tar.gz


# #Build official dcmtk
Expand Down
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ services:
'
volumes :
- ./:/nodejs/raccoon
- /nodejs/raccoon/node_modules
- /nodejs/raccoon/build
- /nodejs/raccoon/models/dcmtk/linux-lib
- ./raccoon-storage:/dicomFiles
- ./raccoon-null/node_modules:/nodejs/raccoon/node_modules
- ./raccoon-null/build:/nodejs/raccoon/build
- ./raccoon-null/models:/nodejs/raccoon/models/dcmtk/linux-lib
ports:
- 8081:8081
depends_on:
Expand Down

0 comments on commit 3e1022c

Please sign in to comment.