From 27ef7f166598c1ed977b42a957306aabc85d10da Mon Sep 17 00:00:00 2001 From: biolxy Date: Thu, 21 Nov 2019 15:44:08 +0800 Subject: [PATCH] 1, Modify python in the container to be python3;2, change 'FROM' to 'FROM ubuntu:16.04';3 ,Specifies module version information for PIP installation; --- Dockerfile | 78 ++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 226fcae..5a77a0b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,50 +15,65 @@ ################################################################# # Source Image -FROM biocontainers/biocontainers:latest +FROM ubuntu:16.04 ################## BEGIN INSTALLATION ########################### USER root # install +RUN printf "deb http://dk.archive.ubuntu.com/ubuntu/ xenial main\ndeb http://dk.archive.ubuntu.com/ubuntu/ xenial universe\n" >> /etc/apt/sources.list RUN apt-get update && apt-get install -y software-properties-common \ -&& apt-get update && apt-get install -y \ gcc-4.9 \ g++-4.9 \ coinor-cbc \ zlib1g-dev \ libbz2-dev \ + libfreetype6-dev \ + libxft-dev \ + curl \ + git \ + cmake \ && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9 \ && rm -rf /var/lib/apt/lists/* \ -&& apt-get clean \ -&& apt-get purge +&& apt-get clean && apt-get purge #HLA Typing #OptiType dependecies -RUN curl -O https://support.hdfgroup.org/ftp/HDF5/current18/bin/hdf5-1.8.21-Std-centos7-x86_64-shared_64.tar.gz \ - && tar -xvf hdf5-1.8.21-Std-centos7-x86_64-shared_64.tar.gz \ - && mv hdf5-1.8.21-Std-centos7-x86_64-shared_64/bin/* /usr/local/bin/ \ - && mv hdf5-1.8.21-Std-centos7-x86_64-shared_64/lib/* /usr/local/lib/ \ - && mv hdf5-1.8.21-Std-centos7-x86_64-shared_64/include/* /usr/local/include/ \ - && mv hdf5-1.8.21-Std-centos7-x86_64-shared_64/share/* /usr/local/share/ \ - && rm -rf hdf5-1.8.21-Std-centos7-x86_64-shared_64/ \ +WORKDIR / +# COPY hdf5-1.8.21-Std-centos7-x86_64-shared_64.tar.gz . +RUN curl -O https://support.hdfgroup.org/ftp/HDF5/current18/bin/hdf5-1.8.21-Std-centos7-x86_64-shared_64.tar.gz && \ + tar -xvf hdf5-1.8.21-Std-centos7-x86_64-shared_64.tar.gz \ + && mv hdf5/bin/* /usr/local/bin/ \ + && mv hdf5/lib/* /usr/local/lib/ \ + && mv hdf5/include/* /usr/local/include/ \ + && mv hdf5/share/* /usr/local/share/ \ + && rm -rf hdf5/ \ && rm -f hdf5-1.8.21-Std-centos7-x86_64-shared_64.tar.gz ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH ENV HDF5_DIR /usr/local/ -RUN pip install --upgrade pip && pip install \ - numpy \ - pyomo \ - pysam \ - matplotlib \ - tables \ - pandas \ - future - + +RUN apt-get update && apt-get install -y python-setuptools python3-dev build-essential python3-pip && apt-get clean && apt-get purge + +# pip install --upgrade pip && +RUN pip3 install \ + numpy==1.10.0 \ + tables==3.2.2 \ + pysam==0.8.3 \ + future==0.15.2 \ + pyomo==4.2.10782 \ + pandas==0.23.0 + +RUN pip3 install matplotlib==1.4.3 + +# 虽然官方指出 Pandas 0.16.2,但安装报错 RuntimeError: Python version >= 3.5 required, 解决: 安装 pandas==0.23.0 ref:https://zhuanlan.zhihu.com/p/76850433 +# matplotlib==1.4.3 \ +# 同理numpy==1.9.3 执行时报错 numpy==1.10.0 + #installing optitype form git repository (version Dec 09 2015) and wirtig config.ini RUN git clone https://github.com/FRED-2/OptiType.git \ - && sed -i -e '1i#!/usr/bin/env python\' OptiType/OptiTypePipeline.py \ + && sed -i -e '1i#!/usr/bin/env python' OptiType/OptiTypePipeline.py \ && mv OptiType/ /usr/local/bin/ \ && chmod 777 /usr/local/bin/OptiType/OptiTypePipeline.py \ && echo "[mapping]\n\ @@ -75,16 +90,27 @@ unpaired_weight=0 \n\ use_discordant=false\n" >> /usr/local/bin/OptiType/config.ini #installing razers3 -RUN git clone https://github.com/seqan/seqan.git seqan-src \ - && cd seqan-src \ +# git clone https://github.com/seqan/seqan.git seqan-src +WORKDIR /opt +RUN git clone https://github.com/seqan/seqan.git seqan-src +RUN cd seqan-src \ && cmake -DCMAKE_BUILD_TYPE=Release \ && make razers3 \ - && cp bin/razers3 /usr/local/bin \ + && cp bin/razers3 /usr/local/bin/ \ && cd .. \ && rm -rf seqan-src ENV PATH=/usr/local/bin/OptiType:$PATH + +# Add user biodocker with password biodocker +RUN mkdir /data /config +RUN groupadd fuse && \ + useradd --create-home --shell /bin/bash --user-group --uid 1000 --groups sudo,fuse biodocker && \ + echo `echo "biodocker\nbiodocker\n" | passwd biodocker` && \ + chown biodocker:biodocker /data && \ + chown biodocker:biodocker /config + # Change user to back to biodocker USER biodocker @@ -92,10 +118,10 @@ USER biodocker WORKDIR /data/ # Define default command -ENTRYPOINT ["OptiTypePipeline.py"] +ENTRYPOINT ["python3", "OptiTypePipeline.py"] CMD ["-h"] ##################### INSTALLATION END ########################## - # File Author / Maintainer MAINTAINER Benjamin Schubert +# modify by biolxy \ No newline at end of file