-
Notifications
You must be signed in to change notification settings - Fork 266
Expand file tree
/
Copy pathDockerfile
More file actions
86 lines (67 loc) · 2.72 KB
/
Dockerfile
File metadata and controls
86 lines (67 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# 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
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 \
git
# Set work directory
WORKDIR '/opt'
# Download and install Julia
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/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'
# Download and install Patchwork
RUN git clone 'https://github.com/fethalen/patchwork' \
&& 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="felix.thalen@cardio-care.ch"
LABEL version="1"
LABEL software="Patchwork"
LABEL software.version="0.5.5"
LABEL about.author="Felix Thalén <felix.thalen@cardio-care.ch>"
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"]