Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
ARG DISTRO_IMAGE=ubuntu
ARG DISTRO_IMAGE_VERSION=20.04
FROM $DISTRO_IMAGE:$DISTRO_IMAGE_VERSION

ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_PRIORITY=critical
RUN apt-get update && \
apt-get install -y \
# general deps \
curl \
build-essential \
make \
gcc \
# jasper deps \
cmake \
automake \
autoconf \
libtool \
m4 \
pkg-config \
# hlrdas deps \
libswitch-perl \
gfortran \
libnetcdf-dev \
# comment libnetcdff-dev to build in 14.04 only available in newer releases \
libnetcdff-dev \
libjpeg-dev \
libjpeg-turbo8-dev \
libbz2-dev \
libgrib2c-dev \
&& apt-get clean

RUN apt install -y \
git

VOLUME /src
WORKDIR /tmp
RUN curl -L https://github.com/mdadams/jasper/archive/version-1.900.31.tar.gz | tar xvz && \
cd jasper* && \
autoreconf -i && \
./configure --prefix /usr && \
make install && \
rm -rf /tmp/jasper*

WORKDIR /src

COPY entrypoint.sh /
ENTRYPOINT /entrypoint.sh
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,16 @@ Repository branch structure (as of July 27, 2018)
master: this is the base branch and contains all finalized development before WRF release

release: branch from master at WRF release intervals; may include important bug fixes after release

Build default Ubuntu 20.04 container with all dependencies:
docker build -t hrldas:latest .

Run default Ubuntu 20.04 container to compile with:
docker run -it --rm --mount type=bind,source=$(pwd),target=/src -w /src/HRLDAS hrldas:latest

Build specific container with:
export DISTRO_IMAGE=ubuntu DISTRO_IMAGE_VERSION=16.04; docker build --build-arg DISTRO_IMAGE=$DISTRO_IMAGE --build-arg DISTRO_IMAGE_VERSION=$DISTRO_IMAGE_VERSION -t hrldas:$DISTRO_IMAGE-$DISTRO_IMAGE_VERSION -t hrldas:latest .

Run specific Ubuntu/Debian container to compile with:
export DISTRO_IMAGE=ubuntu DISTRO_IMAGE_VERSION=16.04
docker run -it --rm --mount type=bind,source=$(pwd),target=/src -w /src/HRLDAS hrldas:$DISTRO_IMAGE-$DISTRO_IMAGE_VERSION
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#/bin/sh
sed -E -e's%/opt/local%/usr%g' -e'/COMPILERF90/s%(=\s+).*%\1gfortran%' -e'/CPP\s/s%(=\s+).*%\1cpp%' -e'/CC\s/s%(=\s+).*%\1gcc%' -e's/-fno-underscoring//' arch/user_build_options.gfortran.serial > ./user_build_options

make clean all