Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
buehlere committed May 24, 2024
1 parent f79ce8e commit 0acba4e
Showing 1 changed file with 49 additions and 30 deletions.
79 changes: 49 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,53 +1,72 @@
################## Base Image ##########
ARG PYTHON_VERSION="3.8"
FROM --platform=linux/amd64 python:${PYTHON_VERSION}-slim
################## BASE IMAGE ######################

FROM ubuntu:latest

################## ARGUMENTS########################

################## ARGUMENTS/Environments ##########
ARG BUILD_DATE
ARG BUILD_VERSION
ARG LICENSE="Apache-2.0"
ARG GENOTYPE_VARIANTS_VERSION
ARG GBCMS_VERSION="1.2.5"
ARG GBCMS_VERSION=1.2.5
ARG VCS_REF

################## METADATA ########################

LABEL org.opencontainers.image.vendor="MSKCC"
LABEL org.opencontainers.image.authors="Eric Buehler (buehlere@mskcc.org)"
LABEL org.opencontainers.image.authors="Ronak Shah (shahr2@mskcc.org)"

LABEL org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.version=${BUILD_VERSION} \
org.opencontainers.image.licenses=${LICENSE} \
org.opencontainers.image.version.pvs=${GENOTYPE_VARIANTS_VERSION} \
org.opencontainers.image.vcs-url="https://github.com/msk-access/genotype_variants.git" \
org.opencontainers.image.vcs-ref=${VCS_REF}
org.opencontainers.image.version=${BUILD_VERSION} \
org.opencontainers.image.revision=${VCS_REF} \
org.opencontainers.image.licenses=${LICENSE} \
org.opencontainers.image.version.gbcms=${GBCMS_VERSION} \
org.opencontainers.image.source="https://github.com/msk-access/GetBaseCountsMultiSample/releases/"

LABEL org.opencontainers.image.description="This container uses python3.8 as the base image to build \
genotype_variants ${GENOTYPE_VARIANTS_VERSION}"
LABEL org.opencontainers.image.description="This container uses Ubuntu 16.04 as the base image to build GetBaseCountsMultiSample version ${GBCMS_VERSION}"

ADD . /opt/genotype_variants
################## INSTALL ##########################

# get build tools and install genotype variants
WORKDIR /usr/src

RUN apt-get update && apt-get install --no-install-recommends -y build-essential ca-certificates openssl gcc g++ make zlib1g-dev cmake libjsoncpp-dev curl unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ADD . ./genotype_variants

RUN cd /opt/ && \
curl -L -O "https://github.com/msk-access/GetBaseCountsMultiSample/archive/refs/tags/v${GBCMS_VERSION}.tar.gz" && \
tar xzvf v${GBCMS_VERSION}.tar.gz && \
cd /opt/GetBaseCountsMultiSample-${GBCMS_VERSION}/bamtools-master && \
rm -r build/ && \
# Install Python Version
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.8 python3.8-dev python3.8-venv python3-pip && \
apt-get clean

# Install GBCMS Dependencies
RUN apt-get update && \
apt-get --no-install-recommends install -y \
wget ca-certificates openssl gcc g++ make zlib1g-dev cmake libjsoncpp-dev && \
apt-get clean autoclean && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install GBCMS
RUN wget --no-check-certificate "https://github.com/msk-access/GetBaseCountsMultiSample/archive/refs/tags/${GBCMS_VERSION}.tar.gz" && \
tar xzvf /usr/src/${GBCMS_VERSION}.tar.gz && \
cd /usr/src/GetBaseCountsMultiSample-${GBCMS_VERSION}/bamtools-master && \
rm -r build/ && \
mkdir build && \
cd build/ && \
cmake -DCMAKE_CXX_FLAGS=-std=c++03 .. && \
make && \
make install && \
cp ../lib/libbamtools.so.2.3.0 /usr/lib/ && \
cd /opt/GetBaseCountsMultiSample-${GBCMS_VERSION} && \
cd /usr/src/GetBaseCountsMultiSample-${GBCMS_VERSION}/ && \
make && \
cp GetBaseCountsMultiSample /usr/local/bin/
cp GetBaseCountsMultiSample /usr/local/bin/

# Create a virtual environment
RUN python3.8 -m venv /opt/venv

# Add the virtual environment's bin directory to the PATH
ENV PATH="/opt/venv/bin:$PATH"

RUN cd /opt/genotype_variants && \
pip install -r requirements_dev.txt && \
python setup.py install
# Install Genotype_variants
RUN cd /usr/src/genotype_variants && \
pip3 install -r requirements_dev.txt && \
python3 setup.py install

0 comments on commit 0acba4e

Please sign in to comment.