Skip to content

Instantly share code, notes, and snippets.

@informationsea informationsea/Dockerfile

Last active Mar 24, 2020
Embed
What would you like to do?
Build TileDBVCF for Cent OS 7
FROM centos:7 AS download-cmake
RUN mkdir -p /download
WORKDIR /download
RUN curl -OL https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0.tar.gz
RUN tar xzf cmake-3.17.0.tar.gz
FROM centos:7 AS build-cmake
RUN yum update -y
RUN yum install -y gcc gcc-c++ make zlib-devel curl-devel openssl-devel libarchive-devel ncurses-devel readline-devel
COPY --from=download-cmake /download/cmake-3.17.0 /src/cmake-3.17.0
WORKDIR /src/cmake-3.17.0
RUN ./configure --prefix=/opt/cmake && make -j4
RUN make install
FROM centos:7 AS download-gcc
RUN mkdir -p /download
WORKDIR /download
RUN curl -OL http://ftp.tsukuba.wide.ad.jp/software/gcc/releases/gcc-9.3.0/gcc-9.3.0.tar.xz
RUN tar xJf gcc-9.3.0.tar.xz
FROM centos:7 AS build-gcc
RUN yum update -y
RUN yum install -y gcc gcc-c++ make zlib-devel libmpc-devel libmpfr-devel libgmp-devel
COPY --from=download-gcc /download/gcc-9.3.0 /src/gcc
RUN mkdir -p /build/gcc
WORKDIR /build/gcc
RUN /src/gcc/configure --prefix=/opt/gcc-9.3.0 --enable-languages=c,c++,fortran,lto --disable-multilib
RUN make -j4
RUN make install
FROM centos:7 AS download-tiledb
RUN mkdir -p /download
WORKDIR /download
RUN yum install -y git
RUN git clone https://github.com/TileDB-Inc/TileDB-VCF.git
WORKDIR /download/TileDB-VCF
RUN git checkout 0.3.1
FROM centos:7 AS build-tildedb
RUN yum install -y gcc gcc-c++ make zlib-devel automake autoconf libtool xz-devel bzip2-devel git openssl-devel libcurl-devel tbb-devel chrpath
COPY --from=build-cmake /opt/cmake /opt/cmake
COPY --from=build-gcc /opt/gcc-9.3.0 /opt/gcc-9.3.0
ENV PATH /opt/cmake/bin:/opt/gcc-9.3.0/bin:$PATH
ENV CC /opt/gcc-9.3.0/bin/gcc
ENV CXX /opt/gcc-9.3.0/bin/g++
WORKDIR /build
COPY --from=download-tiledb /download/TileDB-VCF /build/TileDB-VCF
WORKDIR /build/TileDB-VCF/libtiledbvcf/build
RUN cmake .. && make -j4
RUN make install-libtiledbvcf
RUN cp -P /opt/gcc-9.3.0/lib64/libgcc* /opt/gcc-9.3.0/lib64/libstdc++* /build/TileDB-VCF/dist/lib/
RUN chrpath -r '$ORIGIN/../lib' /build/TileDB-VCF/dist/bin/tiledbvcf
WORKDIR /build/TileDB-VCF/dist/
RUN tar czf /tiledbvcf.tar.gz .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.