forked from StaPH-B/docker-builds
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
65 lines (51 loc) · 2.77 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
FROM python:3.9.17-slim as app
# List all software versions are ARGs near the top of the dockerfile
# 'ARG' sets environment variables during the build stage
# ARG variables are ONLY available during image build, they do not persist in the final image
ARG PHYTREEVIZ_VER="0.2.0"
# 'LABEL' instructions tag the image with metadata that might be important to the user
LABEL base.image="python:3.9.17-slim"
LABEL dockerfile.version="1"
LABEL software="phyTreeViz"
LABEL software.version="${PHYTREEVIZ_VER}"
LABEL description="Visualizing phylogenetic trees"
LABEL website="https://github.com/moshi4/phyTreeViz/"
LABEL license="https://github.com/moshi4/phyTreeViz/blob/main/LICENSE"
LABEL maintainer="Erin Young"
LABEL maintainer.email="[email protected]"
# 'RUN' executes code during the build
# Install dependencies via apt-get or yum if using a centos or fedora base
RUN apt-get update && apt-get install -y --no-install-recommends \
procps \
ca-certificates && \
apt-get autoclean && rm -rf /var/lib/apt/lists/*
# Install and/or setup more things. Make /data for use as a working dir
# For readability, limit one install per 'RUN' statement.
RUN pip install --no-cache phytreeviz==${PHYTREEVIZ_VER}
ENV PATH="$PATH" \
LC_ALL=C
# 'CMD' instructions set a default command when the container is run. This is typically 'tool --help.'
CMD phytreeviz --help
# 'WORKDIR' sets working directory
WORKDIR /data
##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- #####
##### Step 2. Set up the testing stage. #####
##### The docker image is built to the 'test' stage before merging, but #####
##### the test stage (or any stage after 'app') will be lost. #####
##### ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- #####
# A second FROM insruction creates a new stage
FROM app as test
RUN apt-get update && apt-get install -y --no-install-recommends wget unzip
# set working directory so that all test inputs & outputs are kept in /test
WORKDIR /test
# print help and version info; check dependencies (not all software has these options available)
# Mostly this ensures the tool of choice is in path and is executable
RUN phytreeviz --help && \
phytreeviz --version
# Demonstrate that the program is successfully installed - which is highly dependant on what the tool is.
# Run the program's internal tests if available, for example with SPAdes:
RUN wget -q https://github.com/moshi4/phyTreeViz/raw/main/example/example.zip && \
unzip example.zip && \
phytreeviz -i ./example/small_example.nwk -o cli_example_small.png --show_branch_length --show_confidence && \
phytreeviz -i ./example/medium_example.nwk -o cli_example_med.png --fig_height 0.3 --align_leaf_label && \
ls cli_example_med.png cli_example_small.png