-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.cli_base
44 lines (37 loc) · 1.85 KB
/
Dockerfile.cli_base
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
# This Dockerfile provides instructions to build a docker image
# which forms the base image for running the command line interface - cli.py in the root of this repo
# the cli allows us to call whatever python functions in this repo that we
# need for our SOMISANA operations
#
# The docker image is built as part of our operational workflow by
# .github/workflows/build_cli_base_image.yml (which calles .github/workflows/build_images.yml)
# and gets triggered whenever any changes are made toi the Dockerfile.cli_base or environment.yml files
# i.e. the files needed to create the environment needed by the cli
#
# the .github/workflows/build_cli_image.yml is automatically run as part of the operational workflow
# but all this does is to over-write the somisana-croco code in the image, to account for any code edits
# which don't impact the environment.
# We intentionally separate the two steps out, as the base image takes quite a lot of time to build
# which gets annoying when testing new features of the operational workflow
#
# TODO: maybe add a user and run the image as a user rather than as root?
# start with a mambaforge base image
# We're fixing the mambaforge version due to dependency issues which get introduced if left open ended
FROM condaforge/mambaforge:22.9.0-1
ENV DEBIAN_FRONTEND noninteractive
# Install dependencies for compiling fortran tools
RUN apt-get update && apt-get install -y \
make \
build-essential
RUN mkdir /somisana-croco
WORKDIR /somisana-croco
# Install somisana-croco environment into base conda environment
COPY environment.yml .
RUN mamba env update -n base -f environment.yml
# add the somisana-croco code and install into the base environment
ADD . /somisana-croco
RUN pip install -e .
# Now compile the fortran tools
WORKDIR /somisana-croco/crocotools_py/croco_pytools/prepro/Modules/tools_fort_routines/
RUN make clean
RUN make