From 361dfb713a7f0785ad6d0bb7f275395ff24a8274 Mon Sep 17 00:00:00 2001
From: nickb <nickb@ssec.wisc.edu>
Date: Tue, 16 Apr 2019 11:09:03 -0500
Subject: [PATCH] initial changes to use alpine & musl; currently builds up
through hdf5
---
Dockerfile | 41 ++++++++++++++++++-----------------------
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 1c2c7f7..fe47b8f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
# This image creates a common scientific build environment that includes:
# gfortran, hdf4, hdf5, netcdf4
-FROM gcc:latest
+FROM alpine:latest
ENV BUILD /build
ENV OPT /opt
@@ -11,18 +11,19 @@ ENV ZLIB_VERSION 1.2.11
ENV JPEG_VERSION 6b
ENV SZIP_VERSION 2.1
ENV HDF4_VERSION 4.2.12
-ENV HDF5_VERSION 1.10.4
-ENV NC4F_VERSION 4.4.4
-ENV NC4C_VERSION 4.4.1
+ENV HDF5_VERSION 1.10.5
+ENV NC4F_VERSION 4.4.5
+ENV NC4C_VERSION 4.6.1
ENV NCO_VERSION 4.6.1
ENV PYHDF_VERSION 0.9.0
ENV NETCDFPY_VERSION 1.2.4rel
-# grab some packages we need
-RUN apt-get update && apt-get install -y byacc bison diffutils flex make
+# grab some CORE packages we need
+# WE LOST: byacc, screen
+RUN apk update && apk add gcc gfortran g++ bison diffutils flex make libtirpc-dev gawk
# grab some convenience packages for using it as a build "machine"
-RUN apt-get install -y vim less tree screen unzip cvs subversion git gdb valgrind
+RUN apk add vim less tree unzip cvs subversion git gdb valgrind
# this is our install dir for everything non-core
RUN mkdir -p ${OPT}
@@ -38,17 +39,7 @@ RUN mkdir -p ${BUILD} && cd ${BUILD} && \
rm -rf ${BUILD}
# add libjpeg
-# NOTE: this has moved to: http://www.ijg.org/
-# ... can we just use the one in debian instead?
-# https://packages.debian.org/search?keywords=libjpeg
-RUN apt-get install -y libjpeg-dev
-# RUN mkdir -p ${BUILD} && cd ${BUILD} && \
-# wget -q https://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v${JPEG_VERSION}.tar.gz && \
-# tar xzf jpegsrc.v${JPEG_VERSION}.tar.gz && \
-# cd jpeg-${JPEG_VERSION} && \
-# ./configure && make -j4 && make install && \
-# cp config.log ${OPT}/config.log-jpeg-${JPEG_VERSION} && \
-# rm -rf ${BUILD}
+RUN apk add libjpeg-turbo-dev
## add szip
#RUN mkdir -p ${BUILD} && cd ${BUILD} && \
@@ -64,8 +55,9 @@ RUN mkdir -p ${BUILD} ${OPT}/hdf4 && cd ${BUILD} && \
wget -q http://www.hdfgroup.org/ftp/HDF/releases/HDF${HDF4_VERSION}/src/hdf-${HDF4_VERSION}.tar.gz && \
tar xzf hdf-${HDF4_VERSION}.tar.gz && \
cd hdf-${HDF4_VERSION} && \
- CFLAGS="-fPIC -DHAVE_NETCDF -fno-strict-aliasing" \
- CXXFLAGS="-fPIC -DHAVE_NETCDF -fno-strict-aliasing" \
+ LIBS="-ltirpc" \
+ CFLAGS="-fPIC -DHAVE_NETCDF -fno-strict-aliasing -I/usr/include/tirpc" \
+ CXXFLAGS="-fPIC -DHAVE_NETCDF -fno-strict-aliasing -I/usr/include/tirpc" \
./configure --prefix="${OPT}/hdf4" --disable-netcdf --enable-fortran && make -j4 && make install && \
mv ${OPT}/hdf4/bin/ncdump ${OPT}/hdf4/bin/hdfdump && \
mv ${OPT}/hdf4/bin/ncgen ${OPT}/hdf4/bin/hdfgen && \
@@ -82,7 +74,10 @@ RUN mkdir -p ${BUILD} ${OPT}/hdf5 && cd ${BUILD} && \
wget -q https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-${HDF5_VERSION}/src/hdf5-${HDF5_VERSION}.tar.bz2 && \
tar xjf hdf5-${HDF5_VERSION}.tar.bz2 && \
cd hdf5-${HDF5_VERSION} && \
- ./configure --prefix="${OPT}/hdf5" --with-pic --with-zlib="${OPT}/zlib" --enable-cxx --enable-fortran --enable-fortran2003 --with-pthread --with-default-api-version=v18 && make -j4 && make install && \
+ LIBS="-ltirpc" \
+ CFLAGS="-fPIC -DHAVE_NETCDF -fno-strict-aliasing -I/usr/include/tirpc" \
+ CXXFLAGS="-fPIC -DHAVE_NETCDF -fno-strict-aliasing -I/usr/include/tirpc" \
+ ./configure --prefix="${OPT}/hdf5" --with-pic --enable-static-exec --enable-cxx --enable-fortran && make -j4 && make install && \
cp config.log ${OPT}/hdf5/config.log-hdf5-${HDF5_VERSION} && \
rm -rf ${BUILD}
@@ -123,8 +118,8 @@ RUN mkdir -p ${BUILD} ${OPT}/nco && cd ${BUILD} && \
rm -rf ${BUILD}
## add uwglance for verifying data, etc.
-RUN apt-get install -y python-setuptools python-numpy python-scipy python-matplotlib python-mpltoolkits.basemap
-RUN easy_install -f http://larch.ssec.wisc.edu/cgi-bin/repos.cgi uwglance
+#RUN apt-get install -y python-setuptools python-numpy python-scipy python-matplotlib python-mpltoolkits.basemap
+#RUN easy_install -f http://larch.ssec.wisc.edu/cgi-bin/repos.cgi uwglance
# ## add pyhdf for glance to read hdf4 files
# RUN mkdir -p ${BUILD} && cd ${BUILD} && \
--
GitLab