-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
67 lines (54 loc) · 2.35 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
67
################################################################################
# EF5: ENSEMBLE FRAMEWORK FOR FLASH FLOOD FORECASTING
# DOCKER IMPLEMENTATION
################################################################################
# Author: Jorge A. Duarte
# Email: [email protected]/[email protected]
# Version: 1.0
# Date: Apr. 09, 2023
# ------------------------------------------------------------------------------
# This Dockerfile builds one Docker image:
# - 'ef5-container' image which will compile and host the EF5 installation,
# linked to two distinct shared folders:
# + ./conf: where the container will look for an EF5 control file
# + ./data: where the container will look for the required data to run EF5
#
# These image must be instantiated using docker-compose and ./docker-compose.yml
################################################################################
################################################################################
# BUILD ARGUMENTS & ENVIRONMENT VARIABLES
################################################################################
# Use a minimal Alpine Linux base image from Dockerhub for our custom container
# This Linux image is ideal, since it weights only 5MB!
ARG DOCKER_BASE_OS="alpine:3.17"
################################################################################
# BUILD A STANDARD ALPINE LINUX IMAGE FOR THE APPLICATION CONTAINER
################################################################################
FROM ${DOCKER_BASE_OS} as ef5-image
LABEL nssl.wrdd.image.authors="[email protected]"
# Define VOLUMES for Bind Mounts
VOLUME [ "/conf" ]
VOLUME [ "/data" ]
VOLUME [ "/results" ]
# Update the package index
RUN apk update
# Install git, autoconf, automake, and 'build essentials' packages
RUN apk add git
RUN apk add automake
RUN apk add autoconf
RUN apk add build-base
# Install EF5 dependencies
# LibGeoTIFF
RUN apk add libgeotiff-dev
# Set the EF5-DOCKERIZED folder as the working directory
WORKDIR ../
# Clone EF5 from GitHub onto the ef5 folder in the project root
RUN git clone https://github.com/HyDROSLab/EF5.git ./ef5
# Set the ef5 folder as the working directory
WORKDIR ./ef5
# Compile and install EF5
RUN autoreconf --force --install
RUN ./configure
RUN make
# Run ef5
CMD ["/ef5/bin/ef5", "/conf/control.txt"]