From 14aed9687b71d95be3d2e4547ccea931923451db Mon Sep 17 00:00:00 2001 From: tefirman Date: Thu, 9 Jan 2025 14:19:45 -0800 Subject: [PATCH 1/5] Adding initial version of ShapeMapper Dockerfile --- shapemapper/Dockerfile_latest | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 shapemapper/Dockerfile_latest diff --git a/shapemapper/Dockerfile_latest b/shapemapper/Dockerfile_latest new file mode 100644 index 0000000..1fb2139 --- /dev/null +++ b/shapemapper/Dockerfile_latest @@ -0,0 +1,37 @@ +# Use Ubuntu as the base image +FROM ubuntu:22.04 + +# Adding labels for the GitHub Container Registry +LABEL org.opencontainers.image.title="shapemapper" +LABEL org.opencontainers.image.description="Container image for the use of ShapeMapper in FH DaSL's WILDS" +LABEL org.opencontainers.image.version="latest" +LABEL org.opencontainers.image.authors="wilds@fredhutch.org" +LABEL org.opencontainers.image.url=https://hutchdatascience.org/ +LABEL org.opencontainers.image.documentation=https://getwilds.org/ +LABEL org.opencontainers.image.source=https://github.com/getwilds/wilds-docker-library +LABEL org.opencontainers.image.licenses=MIT + +# Prevent interactive prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive + +# Install minimal system dependencies +RUN apt-get update && apt-get install -y \ + wget \ + tar \ + python3 \ + && rm -rf /var/lib/apt/lists/* + +# Download and install ShapeMapper from release tarball +RUN wget https://github.com/Weeks-UNC/shapemapper2/releases/download/v2.3/shapemapper2-2.3.tar.gz \ + && tar -xzf shapemapper2-2.3.tar.gz \ + && rm shapemapper2-2.3.tar.gz \ + && mv shapemapper2-2.3 /opt/shapemapper + +# Add ShapeMapper to PATH +ENV PATH="/opt/shapemapper:${PATH}" + +# Create working directory +WORKDIR /data + +# Default command (can be overridden) +CMD ["shapemapper", "--help"] From e2d486870107eb428fa0e1da6bbe2622300e3c26 Mon Sep 17 00:00:00 2001 From: tefirman Date: Thu, 9 Jan 2025 14:22:53 -0800 Subject: [PATCH 2/5] Fixing hadolint warnings --- shapemapper/Dockerfile_latest | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/shapemapper/Dockerfile_latest b/shapemapper/Dockerfile_latest index 1fb2139..fc7ac90 100644 --- a/shapemapper/Dockerfile_latest +++ b/shapemapper/Dockerfile_latest @@ -14,15 +14,15 @@ LABEL org.opencontainers.image.licenses=MIT # Prevent interactive prompts during package installation ENV DEBIAN_FRONTEND=noninteractive -# Install minimal system dependencies -RUN apt-get update && apt-get install -y \ - wget \ - tar \ - python3 \ +# Install minimal system dependencies with pinned versions and no recommends +RUN apt-get update && apt-get install -y --no-install-recommends \ + wget=1.21.2-2ubuntu1 \ + tar=1.34+dfsg-1ubuntu0.1.22.04.1 \ + python3=3.10.6-1~22.04 \ && rm -rf /var/lib/apt/lists/* # Download and install ShapeMapper from release tarball -RUN wget https://github.com/Weeks-UNC/shapemapper2/releases/download/v2.3/shapemapper2-2.3.tar.gz \ +RUN wget -q https://github.com/Weeks-UNC/shapemapper2/releases/download/v2.3/shapemapper2-2.3.tar.gz \ && tar -xzf shapemapper2-2.3.tar.gz \ && rm shapemapper2-2.3.tar.gz \ && mv shapemapper2-2.3 /opt/shapemapper From 964905f17f0f18d734fa4ea6ce275f6fd3fb96c7 Mon Sep 17 00:00:00 2001 From: tefirman Date: Thu, 9 Jan 2025 14:41:32 -0800 Subject: [PATCH 3/5] Fixing Docker Scout CVEs --- shapemapper/Dockerfile_latest | 41 ++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/shapemapper/Dockerfile_latest b/shapemapper/Dockerfile_latest index fc7ac90..d94616e 100644 --- a/shapemapper/Dockerfile_latest +++ b/shapemapper/Dockerfile_latest @@ -2,23 +2,38 @@ FROM ubuntu:22.04 # Adding labels for the GitHub Container Registry -LABEL org.opencontainers.image.title="shapemapper" -LABEL org.opencontainers.image.description="Container image for the use of ShapeMapper in FH DaSL's WILDS" -LABEL org.opencontainers.image.version="latest" -LABEL org.opencontainers.image.authors="wilds@fredhutch.org" -LABEL org.opencontainers.image.url=https://hutchdatascience.org/ -LABEL org.opencontainers.image.documentation=https://getwilds.org/ -LABEL org.opencontainers.image.source=https://github.com/getwilds/wilds-docker-library -LABEL org.opencontainers.image.licenses=MIT +LABEL org.opencontainers.image.title="shapemapper" \ + org.opencontainers.image.description="Container image for the use of ShapeMapper in FH DaSL's WILDS" \ + org.opencontainers.image.version="latest" \ + org.opencontainers.image.authors="wilds@fredhutch.org" \ + org.opencontainers.image.url=https://hutchdatascience.org/ \ + org.opencontainers.image.documentation=https://getwilds.org/ \ + org.opencontainers.image.source=https://github.com/getwilds/wilds-docker-library \ + org.opencontainers.image.licenses=MIT # Prevent interactive prompts during package installation ENV DEBIAN_FRONTEND=noninteractive -# Install minimal system dependencies with pinned versions and no recommends -RUN apt-get update && apt-get install -y --no-install-recommends \ - wget=1.21.2-2ubuntu1 \ - tar=1.34+dfsg-1ubuntu0.1.22.04.1 \ - python3=3.10.6-1~22.04 \ +# Set shell options +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Update system and install dependencies with dynamic version fetching +RUN apt-get update && \ + apt-get upgrade -y && \ + # Store current versions in variables + WGET_VERSION=$(apt-cache policy wget | grep Candidate | awk '{print $2}') && \ + TAR_VERSION=$(apt-cache policy tar | grep Candidate | awk '{print $2}') && \ + PYTHON3_VERSION=$(apt-cache policy python3 | grep Candidate | awk '{print $2}') && \ + GNUTLS_VERSION=$(apt-cache policy gnutls-bin | grep Candidate | awk '{print $2}') && \ + CA_CERTS_VERSION=$(apt-cache policy ca-certificates | grep Candidate | awk '{print $2}') && \ + # Install packages with specific versions + apt-get install -y --no-install-recommends \ + wget="${WGET_VERSION}" \ + tar="${TAR_VERSION}" \ + python3="${PYTHON3_VERSION}" \ + gnutls-bin="${GNUTLS_VERSION}" \ + ca-certificates="${CA_CERTS_VERSION}" \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Download and install ShapeMapper from release tarball From eb03bd066baca7aa76a9efcfd89bb81a3d556875 Mon Sep 17 00:00:00 2001 From: tefirman Date: Thu, 9 Jan 2025 14:57:57 -0800 Subject: [PATCH 4/5] Adding shapemapper image specific to v2.3 --- shapemapper/Dockerfile_2.3 | 52 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 shapemapper/Dockerfile_2.3 diff --git a/shapemapper/Dockerfile_2.3 b/shapemapper/Dockerfile_2.3 new file mode 100644 index 0000000..d94616e --- /dev/null +++ b/shapemapper/Dockerfile_2.3 @@ -0,0 +1,52 @@ +# Use Ubuntu as the base image +FROM ubuntu:22.04 + +# Adding labels for the GitHub Container Registry +LABEL org.opencontainers.image.title="shapemapper" \ + org.opencontainers.image.description="Container image for the use of ShapeMapper in FH DaSL's WILDS" \ + org.opencontainers.image.version="latest" \ + org.opencontainers.image.authors="wilds@fredhutch.org" \ + org.opencontainers.image.url=https://hutchdatascience.org/ \ + org.opencontainers.image.documentation=https://getwilds.org/ \ + org.opencontainers.image.source=https://github.com/getwilds/wilds-docker-library \ + org.opencontainers.image.licenses=MIT + +# Prevent interactive prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive + +# Set shell options +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# Update system and install dependencies with dynamic version fetching +RUN apt-get update && \ + apt-get upgrade -y && \ + # Store current versions in variables + WGET_VERSION=$(apt-cache policy wget | grep Candidate | awk '{print $2}') && \ + TAR_VERSION=$(apt-cache policy tar | grep Candidate | awk '{print $2}') && \ + PYTHON3_VERSION=$(apt-cache policy python3 | grep Candidate | awk '{print $2}') && \ + GNUTLS_VERSION=$(apt-cache policy gnutls-bin | grep Candidate | awk '{print $2}') && \ + CA_CERTS_VERSION=$(apt-cache policy ca-certificates | grep Candidate | awk '{print $2}') && \ + # Install packages with specific versions + apt-get install -y --no-install-recommends \ + wget="${WGET_VERSION}" \ + tar="${TAR_VERSION}" \ + python3="${PYTHON3_VERSION}" \ + gnutls-bin="${GNUTLS_VERSION}" \ + ca-certificates="${CA_CERTS_VERSION}" \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Download and install ShapeMapper from release tarball +RUN wget -q https://github.com/Weeks-UNC/shapemapper2/releases/download/v2.3/shapemapper2-2.3.tar.gz \ + && tar -xzf shapemapper2-2.3.tar.gz \ + && rm shapemapper2-2.3.tar.gz \ + && mv shapemapper2-2.3 /opt/shapemapper + +# Add ShapeMapper to PATH +ENV PATH="/opt/shapemapper:${PATH}" + +# Create working directory +WORKDIR /data + +# Default command (can be overridden) +CMD ["shapemapper", "--help"] From 4f3cc6fdffd9cf4265b50388ae2f312bed778cdd Mon Sep 17 00:00:00 2001 From: tefirman Date: Thu, 9 Jan 2025 14:58:20 -0800 Subject: [PATCH 5/5] Updating shapemapper image specific to v2.3 --- shapemapper/Dockerfile_2.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shapemapper/Dockerfile_2.3 b/shapemapper/Dockerfile_2.3 index d94616e..04d0d96 100644 --- a/shapemapper/Dockerfile_2.3 +++ b/shapemapper/Dockerfile_2.3 @@ -4,7 +4,7 @@ FROM ubuntu:22.04 # Adding labels for the GitHub Container Registry LABEL org.opencontainers.image.title="shapemapper" \ org.opencontainers.image.description="Container image for the use of ShapeMapper in FH DaSL's WILDS" \ - org.opencontainers.image.version="latest" \ + org.opencontainers.image.version="2.3" \ org.opencontainers.image.authors="wilds@fredhutch.org" \ org.opencontainers.image.url=https://hutchdatascience.org/ \ org.opencontainers.image.documentation=https://getwilds.org/ \