forked from spacetx/starfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (53 loc) · 1.71 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
## Dockerfile for starfish
##
## Default entrypoint is the starfish script,
## but can also be used to run pytests.
##
## Examples:
## --------
##
## (1) Pull the centrally built image
## $ docker pull spacetx/starfish:latest
##
## or, (2) build a local image named "spacetx/starfish"
## $ docker build -t spacetx/starfish .
##
## (3) See the help for starfish
## $ docker run --rm spacetx/starfish -h
##
## (4) Run starfish passing arguments
## $ docker run --rm spacetx/starfish [arguments]
##
## (5) Start bash in the source code directory
## Useful for development.
## $ docker run --rm -it --entrypoint=bash spacetx/starfish
##
## (6) Run the tests on the starfish code base
## $ docker run --rm -it --entrypoint=pytest spacetx/starfish
##
## (7) Print the help for pytests
## $ docker run --rm -it --entrypoint=pytest spacetx/starfish -h
##
## (8) Run TestWithIssData which downloads test data. The
## TEST_ISS_KEEP_DATA flag doesn't delete the data so that the
## data can be extracted from the container with `docker cp`.
## Since no --rm is passed, the container will need to be
## cleaned up later.
##
## $ docker run -e TEST_ISS_KEEP_DATA=true --entrypoint=pytest spacetx/starfish -vsxk TestWithIssData
##
FROM continuumio/miniconda3
RUN useradd -m starfish
USER starfish
# Set up the initial conda environment
COPY --chown=starfish:starfish environment.yml /src/environment.yml
WORKDIR /src
RUN conda env create -f environment.yml
# Prepare for build
COPY --chown=starfish:starfish . /src
RUN echo "source activate starfish" >> ~/.bashrc
ENV PATH /home/starfish/.conda/envs/starfish/bin:$PATH
# Build and configure for running
RUN pip install -e .
env MPLBACKEND Agg
ENTRYPOINT ["starfish"]