forked from NVIDIA-Genomics-Research/gpuci-build-environment
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.centos7
109 lines (95 loc) · 3.12 KB
/
Dockerfile.centos7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and related documentation without an express
# license agreement from NVIDIA CORPORATION is strictly prohibited.
#
ARG FROM_IMAGE=gpuci/miniconda-cuda
ARG CUDA_VER=10.0
ARG LINUX_VERSION=centos7
ARG IMAGE_TYPE=devel
FROM ${FROM_IMAGE}:${CUDA_VER}-${IMAGE_TYPE}-${LINUX_VERSION}
# Capture arguments used for FROM
ARG CUDA_VER
ARG CC_VERSION=7
ARG PYTHON_VERSION=3.6
ARG CENTOS7_GCC7_URL=https://gpuci.s3.us-east-2.amazonaws.com/builds/gcc7.tgz
# Update environment for gcc/g++ builds
ENV GCC7_DIR=/usr/local/gcc7
ENV CC=${GCC7_DIR}/bin/gcc
ENV CXX=${GCC7_DIR}/bin/g++
ENV CUDAHOSTCXX=${GCC7_DIR}/bin/g++
ENV CUDA_HOME=/usr/local/cuda
ENV LD_LIBRARY_PATH=${GCC7_DIR}/lib64:$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/lib
ENV PATH=${GCC7_DIR}/bin:$PATH
# Enables "source activate conda"
SHELL ["/bin/bash", "-c"]
# Install custom packages
RUN yum -y install rpm-build \
screen \
vim \
zlib-devel \
bzip2-devel \
xz-devel \
libcurl-devel \
wget \
# VariantWorks `cyvcf2` dependency
libssl-dev \
# cmake3 dependency
openssl-devel \
# samtools dependency
ncurses-devel
# Add a condarc for channels and override settings
RUN echo -e "\
ssl_verify: False \n\
channels: \n\
- gpuci \n\
- conda-forge \n\
- nvidia \n\
- defaults \n" > /conda/.condarc \
&& cat /conda/.condarc ;
# Create `parabricks` conda env and make default
RUN source activate base \
&& conda install -y gpuci-tools \
&& gpuci_conda_retry create --no-default-packages --override-channels -n parabricks \
-c nvidia \
-c conda-forge \
-c defaults \
-c gpuci \
-c bioconda \
autoconf \
cudatoolkit=${CUDA_VER} \
git \
gpuci-tools \
htslib \
python=${PYTHON_VERSION} \
rsync \
"setuptools<50" \
&& sed -i 's/conda activate base/conda activate parabricks/g' ~/.bashrc
# Install gcc7 from prebuilt tarball
RUN gpuci_retry wget --quiet ${CENTOS7_GCC7_URL} -O /gcc7.tgz \
&& tar xzvf /gcc7.tgz \
&& rm -f /gcc7.tgz
# Install cmake3
RUN wget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3.tar.gz \
&& tar zxvf cmake-3.* \
&& rm -rf cmake-3*.tar.gz \
&& cd cmake-3.* \
&& ./bootstrap --prefix=/usr/local \
&& make -j16 \
&& make install
# Install samtools
RUN wget https://github.com/samtools/samtools/releases/download/1.12/samtools-1.12.tar.bz2 && \
tar -xf samtools-1.12.tar.bz2 && \
cd samtools-1.12 && \
./configure && make && make install
# Create symlink for old scripts expecting `gdf` conda env
RUN ln -s /opt/conda/envs/parabricks /opt/conda/envs/gdf
# Clean up pkgs to reduce image size and chmod for all users
RUN conda clean -afy \
&& chmod -R ugo+w /opt/conda
ENTRYPOINT [ "/usr/bin/tini", "--" ]
CMD [ "/bin/bash" ]