Skip to content

Commit

Permalink
Add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Aug 7, 2024
1 parent 5303593 commit be26cce
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:22.04 AS builder

ENV SNAP_FIMEX_VERSION=1.9

RUN apt-get update -y && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:met-norway/fimex && \
apt-get update -y && \
apt-get install -y libnetcdff-dev gfortran libfimex-$SNAP_FIMEX_VERSION-dev make && \
apt-get remove -y software-properties-common && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/*

WORKDIR /snap
ARG VERSION="latest"
ADD src .
RUN ln --symbolic --force gcc_pkgconfig.mk current.mk
ENV SNAP_USE_OMP=1
RUN make clean && make

FROM ubuntu:22.04

ENV SNAP_FIMEX_VERSION=1.9

RUN apt-get update -y && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:met-norway/fimex && \
apt-get update -y && \
apt-get install -y libnetcdff7 libfimex-$SNAP_FIMEX_VERSION-0 tini && \
apt-get remove -y software-properties-common && \
apt-get -y autoremove && \
rm -rf /var/lib/apt/lists/*

WORKDIR /snap
COPY --from=builder /snap/naccident/bsnap_naccident /snap/bsnap

ENTRYPOINT ["/usr/bin/env", "TINI_VERBOSITY=0", "/usr/bin/tini", "-g", "--", "/snap/bsnap"]
3 changes: 3 additions & 0 deletions src/gcc_pkgconfig.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ endif
ifdef SNAP_BOUND_CHECKS
F77FLAGS+=$(F77BOUNDFLAGS)
endif
ifdef SNAP_USE_OMP
F77FLAGS+=-fopenmp
endif

# optional versioned fimex
FIMEX = fimex
Expand Down

0 comments on commit be26cce

Please sign in to comment.