From a8fa8625d5e8a19628d441c6a974664150224cd5 Mon Sep 17 00:00:00 2001 From: Stephen Beckstrom-Sternberg Date: Fri, 10 Nov 2023 14:36:35 -0700 Subject: [PATCH] Update Dockerfile Save copy of Dockerfile in /github/workflows --- .github/workflows/Dockerfile | 56 ++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/.github/workflows/Dockerfile b/.github/workflows/Dockerfile index 27b1434..4d58470 100644 --- a/.github/workflows/Dockerfile +++ b/.github/workflows/Dockerfile @@ -1,12 +1,52 @@ -FROM python:3.11.6-alpine +ARG HEATCLUSTER_VER="0.4.12" -COPY .github /app/ -COPY assets /app/ -COPY test /app/ -COPY HeatCluster.py LICENSE README.md /app/ +FROM ubuntu:jammy as app +USER root -WORKDIR /app +# re-instantiating for the app build layer if using ARG as a global variable above +ARG HEATCLUSTER_VER -RUN HeatCluster.py +LABEL base.image="ubuntu:jammy" +LABEL dockerfile.version="3" +LABEL software="HeatCluster" +LABEL software.version="${HEATCLUSTER_VER}" +LABEL description="This software produces a heatmap for a SNP matrix" +LABEL website="https://github.com/DrB-S/HeatCluster" +LABEL license="https://github.com/DrB-S/HeatCluster/blob/master/LICENSE" +LABEL name="heatcluster/${HEATCLUSTER_VER}" +LABEL maintainer="Stephen Beckstrom-Sternberg" +LABEL maintainer.email="stephen.beckstrom-sternberg@azdhs.gov" -CMD +# Install Python and pip +RUN apt-get update && apt-get install -y --no-install-recommends \ +apt-utils python3 python3-pip && \ + apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Python dependencies +RUN pip3 install pandas numpy pathlib seaborn matplotlib scipy + +# Set /data as working dir +RUN mkdir /data +WORKDIR /data + +RUN echo "installing heatcluster" && echo + +COPY . . + +RUN echo && echo && ls -latr /data && echo + +# 'ENV' instructions set environment variables that persist from the build into the resulting image +# Use for e.g. $PATH and locale settings for compatibility with Singularity +ENV PATH="/heatcluster-${HEATCLUSTER_VER}/bin:$PATH" \ + LC_ALL=C + +FROM app as test + +# print help and version info +# Mostly this ensures the tool of choice is in path and is executable +RUN echo && echo "Show heatcluster help file and program version number: " && echo && \ +python3 HeatCluster.py --help && \ +python3 HeatCluster.py --version + + RUN echo && echo "Run a test matrix thru the program" && \ +python3 HeatCluster.py -i test/snp-dists.txt && echo