forked from NationalGenomicsInfrastructure/anglerfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (49 loc) · 1.7 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
FROM mambaorg/micromamba as base
LABEL author="Remi-Andre Olsen" \
description="Anglerfish development version" \
maintainer="[email protected]"
USER root
# Check for arm64 architecture to install minimap2
ARG TARGETARCH
ENV MINIMAP_VERSION=2.26
RUN if [ "$TARGETARCH" = "arm64" ]; then \
# Install compliation tools for minimap2
apt-get update;\
apt-get install -y curl build-essential libz-dev;\
# Download minimap2
curl -L https://github.com/lh3/minimap2/archive/refs/tags/v${MINIMAP_VERSION}.tar.gz | tar -zxvf - ;\
# Compile minimap2
cd minimap2-${MINIMAP_VERSION};\
make arm_neon=1 aarch64=1; \
# Add to path
mv minimap2 /usr/local/bin/;\
fi
COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /
COPY --chown=$MAMBA_USER:$MAMBA_USER requirements.txt /
# Remove minimap2 from environment.yml for arm64
RUN if [ "$TARGETARCH" = "arm64" ]; then \
grep -v 'minimap2' /environment.yml > /environment.tmp.yml ;\
else \
cp /environment.yml /environment.tmp.yml ;\
fi ;\
chown $MAMBA_USER:$MAMBA_USER /environment.tmp.yml
# Add source files to the container
ADD . /usr/src/anglerfish
WORKDIR /usr/src/anglerfish
# Activate the environment
ARG MAMBA_DOCKERFILE_ACTIVATE=1
RUN micromamba install -y -n base -f /environment.tmp.yml && micromamba clean --all --yes
#####
# Devcontainer
#####
FROM base as devcontainer
# Useful tools for devcontainer
RUN apt-get update;\
apt-get install -y git vim
RUN eval "$(micromamba shell hook --shell bash)" && python -m pip install -e .[dev]
#####
# Main
#####
FROM base as main
RUN eval "$(micromamba shell hook --shell bash)" && python -m pip install .[dev]
USER $MAMBA_USER