-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed issues with Docker and added Apptainer/Singularity support
- Loading branch information
Showing
4 changed files
with
163 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,19 +11,19 @@ FROM ubuntu:22.04 AS builder | |
# System is non-interactive when building the Docker image | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# Set time zone to Zurich, Europe | ||
ENV TZ=Europe/Zurich | ||
RUN ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "$TZ" > /etc/timezone | ||
|
||
# Update the repository sources and install required tools and libraries | ||
RUN apt-get update && apt-get install --yes --no-install-recommends \ | ||
apt-utils \ | ||
wget \ | ||
gcc \ | ||
ca-certificates \ | ||
python3-matplotlib \ | ||
libqt5widgets5 | ||
|
||
# RUN groupadd --gid 1000 patchwork \ | ||
# && useradd --uid 1000 --gid patchwork --shell /bin/bash --create-home patchwork \ | ||
# && chmod -R a+rwx /home/patchwork | ||
# USER patchwork | ||
libqt5widgets5 \ | ||
git | ||
|
||
# Set work directory | ||
WORKDIR '/opt' | ||
|
@@ -32,67 +32,55 @@ WORKDIR '/opt' | |
RUN wget --quiet 'https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz' \ | ||
&& tar -xvzf 'julia-1.9.3-linux-x86_64.tar.gz' \ | ||
&& rm 'julia-1.9.3-linux-x86_64.tar.gz' | ||
ENV PATH "/opt/julia-1.9.3-rc3/bin:${PATH}" | ||
ENV PATH "/opt/julia-1.9.3/bin:${PATH}" | ||
|
||
# Download and install DIAMOND | ||
RUN wget 'http://github.com/bbuchfink/diamond/releases/download/v2.1.8/diamond-linux64.tar.gz' \ | ||
&& tar -xvzf 'diamond-linux64.tar.gz' \ | ||
&& mv 'diamond' '/usr/local/bin' \ | ||
&& rm 'diamond-linux64.tar.gz' | ||
|
||
# Doad and install Patchwork | ||
ARG PATCHWORK_VERSION='0.5.2' | ||
RUN wget -O "patchwork-${PATCHWORK_VERSION}.tar.gz" "https://github.com/fethalen/Patchwork/archive/refs/tags/v${PATCHWORK_VERSION}.tar.gz" \ | ||
&& tar -xvzf "patchwork-${PATCHWORK_VERSION}.tar.gz" \ | ||
&& rm "patchwork-${PATCHWORK_VERSION}.tar.gz" \ | ||
&& cd "Patchwork-${PATCHWORK_VERSION}" \ | ||
&& julia --project=. -e "import Pkg; Pkg.instantiate()" \ | ||
&& julia --project=. src/compile.jl . src/precompiled.jl ../patchwork-$VERSION | ||
|
||
# Download and install Patchwork | ||
RUN git clone 'https://github.com/fethalen/patchwork' \ | ||
&& cd patchwork \ | ||
&& julia --project=. -e 'import Pkg; Pkg.instantiate()' \ | ||
&& julia --project=. src/compile.jl . src/precompiled.jl ../patchwork-$VERSION | ||
|
||
# # Stage 2/2: Production | ||
# # --------------------- | ||
|
||
# # Set the base image | ||
# FROM ubuntu:22.04 | ||
|
||
# # File maintainer | ||
# MAINTAINER Felix Thalén <[email protected]> | ||
|
||
# # System is non-interactive when building the Docker image | ||
# ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# # Set time zone to Zurich, Europe | ||
# ENV TZ=Europe/Zurich | ||
# RUN ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "$TZ" > /etc/timezone | ||
|
||
# # Metadata | ||
# LABEL base_image="ubuntu:20.04" | ||
# LABEL version="1" | ||
# LABEL software="Patchwork" | ||
# LABEL software.version="0.5.2" | ||
# LABEL about.author="Felix Thalén <[email protected]>" | ||
# LABEL about.summary="Alignment-based Exon Retrieval and Concatenation with Phylogenomic Applications" | ||
# LABEL about.home="https://github.com/fethalen/Patchwork" | ||
# LABEL about.documentation="https://github.com/fethalen/Patchwork#readme" | ||
# LABEL about.license="SPDX:GPL-3.0" | ||
# LABEL about.license_file="https://github.com/fethalen/Patchwork/blob/main/LICENSE" | ||
# LABEL about.tags="phylogenomics" | ||
|
||
# RUN groupadd --gid 1000 patchwork \ | ||
# && useradd --uid 1000 --gid patchwork --shell /bin/bash --create-home patchwork \ | ||
# && chmod -R a+rwx /home/patchwork | ||
# WORKDIR /home/patchwork | ||
# USER patchwork | ||
# ENV VERSION 0.5.2 | ||
|
||
# COPY --from=builder /home/patchwork/patchwork-$VERSION patchwork-$VERSION | ||
# COPY --from=builder /home/patchwork/diamond diamond | ||
# RUN ln -s patchwork-$VERSION/bin/patchwork patchwork | ||
# ENV PATH /home/patchwork:$PATH | ||
|
||
# CMD patchwork --help | ||
&& cd patchwork/build \ | ||
&& ./build_app.jl | ||
|
||
# Stage 2/2: Production | ||
# --------------------- | ||
|
||
# Set the base image | ||
FROM ubuntu:22.04 AS production | ||
|
||
# Metadata | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL version="1" | ||
LABEL software="Patchwork" | ||
LABEL software.version="0.5.5" | ||
LABEL about.author="Felix Thalén <[email protected]>" | ||
LABEL about.summary="Alignment-based Exon Retrieval and Concatenation with Phylogenomic Applications" | ||
LABEL about.home="https://github.com/fethalen/patchwork" | ||
LABEL about.documentation="https://github.com/fethalen/patchwork#readme" | ||
LABEL about.license="SPDX:GPL-3.0" | ||
LABEL about.tags="phylogenomics, phylogenetics, genomics, alignment" | ||
|
||
# System is non-interactive when building the Docker image | ||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
# Set time zone to Zurich, Europe | ||
ENV TZ=Europe/Zurich | ||
RUN ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "$TZ" > /etc/timezone | ||
|
||
# Create the user | ||
RUN useradd --create-home --shell /bin/bash --user-group --uid 1000 patchwork | ||
|
||
# Set the default user | ||
USER patchwork | ||
|
||
# Set the working directory | ||
WORKDIR /home/patchwork | ||
|
||
COPY --from=builder /opt/patchwork/build/compiled /opt/patchwork | ||
COPY --from=builder /usr/local/bin/diamond /usr/local/bin/diamond | ||
ENV PATH /opt/patchwork/bin:$PATH | ||
|
||
ENTRYPOINT ["patchwork"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
Bootstrap: docker | ||
From: ubuntu:22.04 | ||
Stage: builder | ||
|
||
%post | ||
# To reduce the final image size, the build process has been split into a build | ||
# stage and a production stage. After compiling Patchwork, the Julia | ||
# installation is no longer needed and is therefore removed in the second stage. | ||
|
||
# Stage 1/2: Build | ||
# ---------------- | ||
|
||
# Set the base image | ||
|
||
# System is non-interactive when building the Docker image | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
# Set time zone to Zurich, Europe | ||
TZ=Europe/Zurich | ||
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "$TZ" > /etc/timezone | ||
|
||
# Update the repository sources and install required tools and libraries | ||
apt-get update && apt-get install --yes --no-install-recommends \ | ||
apt-utils \ | ||
wget \ | ||
gcc \ | ||
ca-certificates \ | ||
python3-matplotlib \ | ||
libqt5widgets5 \ | ||
git | ||
|
||
# Set work directory | ||
mkdir -p '/opt' | ||
cd '/opt' | ||
|
||
# Download and install Julia | ||
wget --quiet 'https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz' \ | ||
&& tar -xvzf 'julia-1.9.3-linux-x86_64.tar.gz' \ | ||
&& rm 'julia-1.9.3-linux-x86_64.tar.gz' | ||
PATH="/opt/julia-1.9.3/bin:${PATH}" | ||
|
||
# Download and install DIAMOND | ||
wget 'http://github.com/bbuchfink/diamond/releases/download/v2.1.8/diamond-linux64.tar.gz' \ | ||
&& tar -xvzf 'diamond-linux64.tar.gz' \ | ||
&& mv 'diamond' '/usr/local/bin' \ | ||
&& rm 'diamond-linux64.tar.gz' | ||
|
||
# Download and install Patchwork | ||
git clone 'https://github.com/fethalen/patchwork' \ | ||
&& cd patchwork/build \ | ||
&& ./build_app.jl | ||
|
||
# Stage 2/2: Production | ||
# --------------------- | ||
|
||
# Set the base image | ||
%environment | ||
export DEBIAN_FRONTEND=noninteractive | ||
export TZ=Europe/Zurich | ||
export PATH="/opt/julia-1.9.3/bin:${PATH}" | ||
|
||
Bootstrap: docker | ||
From: ubuntu:22.04 | ||
Stage: production | ||
|
||
%files from builder | ||
/opt/patchwork/build/compiled /opt/patchwork | ||
/usr/local/bin/diamond /usr/local/bin/diamond | ||
%labels | ||
org.opencontainers.image.authors="[email protected]" | ||
version="1" | ||
software="Patchwork" | ||
software.version="0.5.4" | ||
about.author="Felix Thalén <[email protected]>" | ||
about.summary="Alignment-based Exon Retrieval and Concatenation with Phylogenomic Applications" | ||
about.home="https://github.com/fethalen/patchwork" | ||
about.documentation="https://github.com/fethalen/patchwork#readme" | ||
about.license="SPDX:GPL-3.0" | ||
about.tags="phylogenomics, phylogenetics, genomics, alignment" | ||
%post | ||
|
||
# Metadata | ||
|
||
# System is non-interactive when building the Docker image | ||
DEBIAN_FRONTEND=noninteractive | ||
|
||
# Set time zone to Zurich, Europe | ||
TZ=Europe/Zurich | ||
ln -snf "/usr/share/zoneinfo/${TZ}" /etc/localtime && echo "$TZ" > /etc/timezone | ||
|
||
# Create the user | ||
useradd --create-home --shell /bin/bash --user-group --uid 1000 patchwork | ||
|
||
# Set the default user | ||
su - patchwork # USER patchwork | ||
|
||
# Set the working directory | ||
mkdir -p /home/patchwork | ||
cd /home/patchwork | ||
|
||
PATH=/opt/patchwork/bin:$PATH | ||
|
||
%environment | ||
export DEBIAN_FRONTEND=noninteractive | ||
export TZ=Europe/Zurich | ||
export PATH=/opt/patchwork/bin:$PATH | ||
%runscript | ||
cd /home/patchwork | ||
exec patchwork "$@" | ||
%startscript | ||
cd /home/patchwork | ||
exec patchwork "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters