Skip to content

Commit

Permalink
Merge pull request #151 from getwilds/shapemapper
Browse files Browse the repository at this point in the history
Adding Shapemapper Docker Image
  • Loading branch information
tefirman authored Jan 9, 2025
2 parents f054da5 + 4f3cc6f commit 8c4bb44
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
52 changes: 52 additions & 0 deletions shapemapper/Dockerfile_2.3
Original file line number Diff line number Diff line change
@@ -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="2.3" \
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"]
52 changes: 52 additions & 0 deletions shapemapper/Dockerfile_latest
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 8c4bb44

Please sign in to comment.