Skip to content

Commit

Permalink
fix: further updates + add build YML for Docker build action
Browse files Browse the repository at this point in the history
  • Loading branch information
sr-murthy committed May 4, 2024
1 parent acf7fc8 commit 33ce737
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:

build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag hdf-h4cf-test:$(date +%s)
23 changes: 12 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:18.04
FROM ubuntu:20.04

MAINTAINER The HDF-EOS Tools and Information Center <eoshelp@hdfgroup.org>

Expand All @@ -13,28 +13,28 @@ ARG HDF4_VER=4.2.16
RUN wget https://hdf-wordpress-1.s3.amazonaws.com/wp-content/uploads/manual/HDF4/HDF${HDF4_VER}-2/src/hdf-${HDF4_VER}-2.tar.gz && \
tar zxvf hdf-${HDF4_VER}-2.tar.gz && \
cd hdf-${HDF4_VER}-2 && \
./configure --prefix=/usr/local/ --enable-shared --disable-netcdf --disable-fortran && \
./configure --enable-shared --disable-netcdf --disable-fortran && \
make && make check && make install && \
cd .. && \
rm -f hdf-${HDF4_VER}-2.tar.gz

#Build HDF-EOS2 lib.
ARG HDFEOS_VER=3.0
RUN wget -O hdf-eos2-${HDFEOS_VER}-src.tar.gz https://git.earthdata.nasa.gov/projects/DAS/repos/hdfeos/raw/hdf-eos2-${HDFEOS_VER}-src.tar.gz?at=3128a738021501c821549955f6c78348e5f33850 && \
tar zxvf hdf-eos2-${HDFEOS_VER}-src.tar.gz && \
cd hdf-eos2-${HDFEOS_VER} && \
./configure --prefix=/usr/local/ --enable-install-include --with-hdf4=/usr/local && \
ARG HDFEOS2_VER=2.20v1.00
RUN wget -O hdf-eos${HDFEOS2_VER}.tar.Z https://git.earthdata.nasa.gov/rest/git-lfs/storage/DAS/hdfeos/cb0f900d2732ab01e51284d6c9e90d0e852d61bba9bce3b43af0430ab5414903?response-content-disposition=attachment%3B%20filename%3D%22HDF-EOS${HDFEOS_VER}.tar.Z%22%3B%20filename*%3Dutf-8%27%27HDF-EOS2.20v1.00.tar.Z && \
tar zxvf hdf-eos${HDFEOS2_VER}.tar.Z && \
cd hdfeos && \
./configure --enable-install-include --with-hdf4=/usr/local && \
make && make check && make install && \
cd .. && \
rm -f hdf-eos2-${HDFEOS_VER}-src.tar.gz
rm -f hdf-eos${HDFEOS2_VER}.tar.Z

# Build HDF5 lib.
ARG HDF5_VER=1.14.4-2
ARG HDF5_DOTVER=1.14.4.2
RUN wget https://github.com/HDFGroup/hdf5/releases/download/hdf5_${HDF5_DOTVER}/hdf5-${HDF5_VER}.tar.gz && \
tar zxvf hdf5-${HDF5_VER}.tar.gz && \
cd hdf5-${HDF5_VER} && \
./configure --prefix=/usr/local/ && \
./configure && \
make && make check && make install && \
cd .. && \
rm -f hdf5-${HDF5_VER}.tar.gz
Expand All @@ -44,7 +44,8 @@ ARG NETCDF_C_VER=4.9.2
RUN wget https://github.com/Unidata/netcdf-c/archive/refs/tags/v${NETCDF_C_VER}.tar.gz && \
tar zxvf v${NETCDF_C_VER}.tar.gz && \
cd netcdf-c-${NETCDF_C_VER} && \
CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LD_LIBRARY_PATH=-L/usr/local/lib && \
CPPFLAGS="-Ihdf5-${HDF5_VER}/include -Ihdf-${HDF4_VER}-2/include" \
LDFLAGS="-Lhdf5-${HDF5_VER}/lib -Lhdf-${HDF4_VER}-2/lib" && \
./configure --prefix=/usr/local --disable-byterange --enable-shared --enable-hdf4 --enable-hdf4-file-tests && \
make && make check && make install && \
cd .. && rm -rf netcdf-c-${NETCDF_C_VER} && rm -f v${NETCDF_C_VER}.tar.gz
Expand All @@ -55,7 +56,7 @@ RUN wget http://hdfeos.org/software/h4cflib/h4cflib_${H4CF_VER}.tar.gz && \
tar zxvf h4cflib_${H4CF_VER}.tar.gz && \
cd h4cflib_${H4CF_VER} && \
CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib LD_LIBRARY_PATH=-L/usr/local/lib && \
./configure --prefix=/usr/local/ --with-hdf4=/usr/local/ --with-hdfeos2=/usr/local/ --with-netcdf=/usr/local/ && \
./configure --with-hdf4=hdf-${HDF4_VER}-2 --with-hdfeos2=hdfeos --with-netcdf=hdf5-${HDF5_VER} && \
make && make install && \
cd .. && \
rm -f hf4cflib_${H4CF_VER}.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker-h4cf

## Ubuntu based Docker container for HDF4 CF Conversion Toolkit
## Ubuntu Docker image for HDF4 CF Conversion Toolkit

The Docker file `Dockerfile` sources an Apt package file named `apt.txt`, which lists the Apt packages required to build the image.

Expand Down

0 comments on commit 33ce737

Please sign in to comment.