-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
66 lines (53 loc) · 2.48 KB
/
Dockerfile
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
FROM --platform=linux/amd64 mambaorg/micromamba:latest as micromamba
# First Stage of the build, gets the jar for encyclopedia
FROM --platform=linux/amd64 openjdk:8-jre
ARG VERSION=2.12.30
ENV VERSION ${VERSION}
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install libgomp1 && \
apt-get clean
WORKDIR /code
RUN wget https://bitbucket.org/searleb/encyclopedia/downloads/encyclopedia-${VERSION}-executable.jar
WORKDIR /app
LABEL authors="[email protected]" \
description="Docker image for most of nf-encyclopedia"
# Install procps so that Nextflow can poll CPU usage and
# deep clean the apt cache to reduce image/layer size
RUN apt-get update \
&& apt-get install -y procps sqlite3 \
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
# Setup micromamba:
ARG MAMBA_USER=mamba
ARG MAMBA_USER_ID=1000
ARG MAMBA_USER_GID=1000
ENV MAMBA_USER=$MAMBA_USER
ENV MAMBA_ROOT_PREFIX="/opt/conda"
ENV MAMBA_EXE="/bin/micromamba"
COPY --from=micromamba "$MAMBA_EXE" "$MAMBA_EXE"
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh
COPY --from=micromamba /usr/local/bin/_entrypoint.sh /usr/local/bin/_entrypoint.sh
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_initialize_user_accounts.sh /usr/local/bin/_dockerfile_initialize_user_accounts.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_setup_root_prefix.sh /usr/local/bin/_dockerfile_setup_root_prefix.sh
RUN /usr/local/bin/_dockerfile_initialize_user_accounts.sh && \
/usr/local/bin/_dockerfile_setup_root_prefix.sh
# Setup the environment
USER root
COPY environment.yml /tmp/environment.yml
# Instruct R processes to use these empty files instead of
# clashing with a local one
RUN touch .Rprofile .Renviron
# Create the environment
RUN micromamba install -y -n base -f /tmp/environment.yml && \
micromamba clean --all --yes
# Setup the EncyclopeDIA executable:
RUN ln -s /code/encyclopedia-$VERSION-executable.jar /code/encyclopedia.jar
# Set the path. NextFlow seems to circumvent the conda environment
# We also need to set options for the JRE here.
ENV PATH="$MAMBA_ROOT_PREFIX/bin:$PATH" _JAVA_OPTIONS="-Djava.awt.headless=true" VERSION=$VERSION
# Create the entrypoint:
SHELL ["/usr/local/bin/_dockerfile_shell.sh"]
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]
CMD []