Skip to content

Commit

Permalink
per #1546, moved logic to build MET in Docker into a script to call f…
Browse files Browse the repository at this point in the history
…rom a Dockerfile so that it can be called from Dockerfile and Dockerfile.copy
  • Loading branch information
georgemccabe committed Jan 20, 2022
1 parent d3a0487 commit d07fcb0
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
19 changes: 1 addition & 18 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,4 @@ RUN echo "Checking out MET ${MET_GIT_NAME} from ${MET_GIT_URL}" \
&& git clone ${MET_GIT_URL} /met/MET-${MET_GIT_NAME} \
&& cd /met/MET-${MET_GIT_NAME}/met \
&& git checkout ${MET_GIT_NAME} \
&& LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_configure.log \
&& echo "Running bootstrap" \
&& ./bootstrap \
&& echo "Configuring MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}" \
&& ./configure --enable-grib2 --enable-mode_graphics --enable-modis --enable-lidar2nc --enable-python \
MET_HDF=/usr/local/hdf MET_HDFEOS=/usr/local/hdfeos \
MET_FREETYPEINC=/usr/include/freetype2 MET_FREETYPELIB=/usr/lib \
MET_CAIROINC=/usr/include/cairo MET_CAIROLIB=/usr/lib \
MET_PYTHON_CC='-I/usr/include/python3.6m' MET_PYTHON_LD='-lpython3.6m' > ${LOG_FILE} \
&& LOG_FILE=/met/MET-${MET_GIT_NAME}/make_install.log \
&& echo "Compiling MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}" \
&& make install > ${LOG_FILE} \
&& LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_make_test.log \
&& echo "Testing MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}" \
&& make test > ${LOG_FILE} 2>&1 \
&& if [[ $MET_GIT_NAME == "v"* ]]; then cd /met; rm -rf MET-*; fi \
&& echo "Downloading GhostScript fonts from ${GSFONT_URL}" \
&& curl -SL ${GSFONT_URL} | tar zxC /usr/local/share/met
&& ./scripts/docker/build_met_docker.sh
4 changes: 4 additions & 0 deletions scripts/docker/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,7 @@ RUN echo "Downloading HDF4.2r3 from ${HDF4_URL}" \
&& cp include/*.h /usr/local/hdfeos/include/. \
&& cd /met/external_libs \
&& rm -rf HDF4.2r3 hdfeos

RUN echo "Downloading GhostScript fonts from ${GSFONT_URL} into /usr/local/share/met" \
&& mkdir -p /usr/local/share/met \
&& curl -SL ${GSFONT_URL} | tar zxC /usr/local/share/met
27 changes: 27 additions & 0 deletions scripts/docker/build_met_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#! /bin/bash

echo "Running script to build MET in Docker"

LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_configure.log

echo "Running bootstrap"
./bootstrap

echo "Configuring MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
./configure --enable-grib2 --enable-mode_graphics --enable-modis --enable-lidar2nc --enable-python \
MET_HDF=/usr/local/hdf MET_HDFEOS=/usr/local/hdfeos \
MET_FREETYPEINC=/usr/include/freetype2 MET_FREETYPELIB=/usr/lib \
MET_CAIROINC=/usr/include/cairo MET_CAIROLIB=/usr/lib \
MET_PYTHON_CC='-I/usr/include/python3.6m' MET_PYTHON_LD='-lpython3.6m' > ${LOG_FILE}

LOG_FILE=/met/MET-${MET_GIT_NAME}/make_install.log
echo "Compiling MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
make install > ${LOG_FILE}

LOG_FILE=/met/logs/MET-${MET_GIT_NAME}_make_test.log
echo "Testing MET ${MET_GIT_NAME} and writing log file ${LOG_FILE}"
make test > ${LOG_FILE} 2>&1

if [[ $MET_GIT_NAME == "v"* ]]; then
cd /met; rm -rf MET-*;
fi

0 comments on commit d07fcb0

Please sign in to comment.