Skip to content

Commit 8aacbd8

Browse files
committed
Simplified single-stage Dockerfile
1 parent 42fec0f commit 8aacbd8

File tree

1 file changed

+18
-73
lines changed

1 file changed

+18
-73
lines changed

Dockerfile

Lines changed: 18 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
FROM ubuntu:22.04 as build
1+
FROM eclipse-temurin:17-jdk-jammy
22

33
RUN apt-get -y update && apt-get install -y apt-utils && \
44
apt-get install -y -qq -o=Dpkg::Use-Pty=0 build-essential gfortran zlib1g-dev \
5-
libhdf5-dev libcurl4-openssl-dev libboost-dev cmake wget python3
5+
libhdf5-dev libcurl4-openssl-dev libboost-dev cmake wget python3 && \
6+
apt-get install -q -y --no-install-recommends curl dnsutils
67

7-
##
8-
## build PETSc with mpich for static linking
9-
##
10-
#RUN mkdir /usr/local/petsc && \
11-
# cd /usr/local/petsc && \
12-
# wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.7.7.tar.gz && \
13-
# tar xzf petsc-3.7.7.tar.gz && \
14-
# cd petsc-3.7.7 && \
15-
# ./configure --with-shared-libraries=0 --download-fblaslapack=1 --with-debugging=1 --download-mpich && \
16-
# make PETSC_DIR=/usr/local/petsc/petsc-3.7.7 PETSC_ARCH=arch-linux2-c-debug all
8+
# Create a custom Java runtime
9+
RUN $JAVA_HOME/bin/jlink \
10+
--add-modules ALL-MODULE-PATH \
11+
--strip-debug \
12+
--no-man-pages \
13+
--no-header-files \
14+
--compress=2 \
15+
--output /javaruntime
16+
17+
ENV JAVA_HOME=/javaruntime
18+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
1719

18-
#ENV PETSC_DIR=/usr/local/petsc/petsc-3.7.7 \
19-
# PETSC_ARCH=arch-linux2-c-debug
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
ENV LANG=en_US.UTF-8
2022

2123
COPY . /vcellroot
2224

23-
#
24-
# build most solvers, and FiniteVolume without PETSc (FiniteVolume_x64)
25-
#
2625
RUN mkdir -p /vcellroot/build/bin
2726
WORKDIR /vcellroot/build
2827

@@ -41,62 +40,8 @@ RUN /usr/bin/cmake \
4140
-DOPTION_TARGET_HY3S_SOLVERS=OFF \
4241
.. && \
4342
make && \
44-
ctest -VV
45-
46-
##
47-
## build FiniteVolume with PETSc (FiniteVolume_PETSc_x64)
48-
##
49-
#RUN mkdir -p /vcellroot/build_PETSc/bin
50-
#WORKDIR /vcellroot/build_PETSc
51-
#
52-
#RUN /usr/bin/cmake \
53-
# -DOPTION_TARGET_MESSAGING=ON \
54-
# -DOPTION_TARGET_PARALLEL=OFF \
55-
# -DOPTION_TARGET_PETSC=ON \
56-
# -DOPTION_TARGET_CHOMBO2D_SOLVER=OFF \
57-
# -DOPTION_TARGET_CHOMBO3D_SOLVER=OFF \
58-
# -DOPTION_TARGET_SMOLDYN_SOLVER=OFF \
59-
# -DOPTION_TARGET_FV_SOLVER=ON \
60-
# -DOPTION_TARGET_STOCHASTIC_SOLVER=OFF \
61-
# -DOPTION_TARGET_NFSIM_SOLVER=OFF \
62-
# -DOPTION_TARGET_MOVINGBOUNDARY_SOLVER=OFF \
63-
# -DOPTION_TARGET_SUNDIALS_SOLVER=OFF \
64-
# -DOPTION_TARGET_HY3S_SOLVERS=OFF \
65-
# .. && \
66-
# make && \
67-
# ctest
68-
69-
70-
FROM eclipse-temurin:17 as jre-build
71-
72-
# Create a custom Java runtime
73-
RUN $JAVA_HOME/bin/jlink \
74-
--add-modules ALL-MODULE-PATH \
75-
--strip-debug \
76-
--no-man-pages \
77-
--no-header-files \
78-
--compress=2 \
79-
--output /javaruntime
43+
ctest -VV && \
44+
mv /vcellroot/build/bin /vcellbin
8045

81-
# Define base image and copy in jlink created minimal Java 17 environment
82-
FROM python:3.9.7-slim
83-
ENV JAVA_HOME=/opt/java/openjdk
84-
ENV PATH "${JAVA_HOME}/bin:${PATH}"
85-
COPY --from=jre-build /javaruntime $JAVA_HOME
86-
87-
# now we have Java 17 and Python 3.9
88-
ENV DEBIAN_FRONTEND noninteractive
89-
ENV LANG=en_US.UTF-8
90-
91-
RUN apt-get update && \
92-
apt-get install -y apt-utils && \
93-
apt-get install -q -y --no-install-recommends curl dnsutils
94-
95-
RUN apt-get install -qq -y -o=Dpkg::Use-Pty=0 gcc gfortran zlib1g \
96-
libhdf5-103 libhdf5-cpp-103 libcurl4-openssl-dev zip
97-
98-
COPY --from=build /vcellroot/build/bin /vcellbin
99-
#COPY --from=build /vcellroot/build_PETSc/bin/FiniteVolume_PETSc_x64 /vcellbin/
10046
WORKDIR /vcellbin
10147
ENV PATH=/vcellbin:$PATH
102-

0 commit comments

Comments
 (0)