From 86e55190d1014f0dd7ee2b827ea4dce4bae17c67 Mon Sep 17 00:00:00 2001 From: John Halley Gotway Date: Fri, 25 Aug 2023 11:56:51 -0600 Subject: [PATCH] Per #12, replace Centos image with Debian one --- .github/jobs/build_docker_image.sh | 4 +- Dockerfile.debian | 72 ------------------------------ Dockerfile.debian_unit_test_env | 26 ----------- 3 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 Dockerfile.debian delete mode 100644 Dockerfile.debian_unit_test_env diff --git a/.github/jobs/build_docker_image.sh b/.github/jobs/build_docker_image.sh index 79214e9..dd973a5 100755 --- a/.github/jobs/build_docker_image.sh +++ b/.github/jobs/build_docker_image.sh @@ -5,7 +5,7 @@ MET_BASE_TAG=${GITHUB_TAG} DOCKERHUB_TAG_BASE=${DOCKERHUB_BASE_REPO}:${MET_BASE_TAG} -DOCKERFILE_PATH=${GITHUB_WORKSPACE}/Dockerfile.debian +DOCKERFILE_PATH=${GITHUB_WORKSPACE}/Dockerfile CMD_LOGFILE=${GITHUB_WORKSPACE}/docker_build_base_image.log @@ -18,7 +18,7 @@ fi DOCKERHUB_TAG_UNIT_TEST=${DOCKERHUB_UNIT_TEST_REPO}:${GITHUB_TAG} -DOCKERFILE_PATH=${GITHUB_WORKSPACE}/Dockerfile.debian_unit_test_env +DOCKERFILE_PATH=${GITHUB_WORKSPACE}/Dockerfile.unit_test_env CMD_LOGFILE=${GITHUB_WORKSPACE}/docker_build_unit_test_env.log diff --git a/Dockerfile.debian b/Dockerfile.debian deleted file mode 100644 index eb5f6c0..0000000 --- a/Dockerfile.debian +++ /dev/null @@ -1,72 +0,0 @@ -ARG DEBIAN_VERSION=10 -FROM debian:${DEBIAN_VERSION}-slim -MAINTAINER George McCabe - -# -# Define the compilers. -# -ENV CC /usr/bin/gcc -ENV CXX /usr/bin/g++ -ENV FC /usr/bin/gfortran -ENV F77 /usr/bin/gfortran - -ENV PYTHON_VER 3.10.4 - -ENV GSFONT_URL https://dtcenter.ucar.edu/dfiles/code/METplus/MET/docker_data/ghostscript-fonts-std-8.11.tar.gz - -# -# Setup the environment for interactive bash shell. -# Set soft limit to unlimited to prevent GRIB2 seg faults -# -RUN echo export MET_BASE=/usr/local/share/met >> /root/.bashrc \ - && echo export MET_FONT_DIR=/usr/local/share/met/fonts >> /root/.bashrc \ - && echo export RSCRIPTS_BASE=/usr/local/share/met/Rscripts >> /root/.bashrc \ - && echo ulimit -S -s unlimited >> /root/.bashrc - -ENV MET_FONT_DIR /usr/local/share/met/fonts - -# Install required system tools -RUN apt update && apt -y upgrade \ - && apt install -y build-essential gfortran wget unzip curl imagemagick \ - libcurl4-gnutls-dev m4 git automake flex bison libjpeg-dev libpixman-1-dev \ - emacs less \ - libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev \ - libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev - -# -# Install Python -# https://linuxhint.com/install-python-debian-10/ -# -RUN wget https://www.python.org/ftp/python/${PYTHON_VER}/Python-${PYTHON_VER}.tgz \ - && tar xzf Python-${PYTHON_VER}.tgz \ - && cd Python-${PYTHON_VER} \ - && ./configure --enable-optimizations --enable-shared LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib" \ - && make -j `nproc` \ - && make install \ - && python3 -m pip install --upgrade pip \ - && python3 -m pip install numpy xarray netCDF4 - -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 - -# Fix rules for ghostscript files in convert -# See: https://en.linuxportal.info/tutorials/troubleshooting/how-to-fix-errors-from-imagemagick-imagick-conversion-system-security-policy -# -RUN sed -i 's/policy domain="coder" rights="none" pattern="PS/policy domain="coder" rights="read | write" pattern="PS/g' /etc/ImageMagick-6/policy.xml \ - && sed -i 's/policy domain="coder" rights="none" pattern="EPS"/policy domain="coder" rights="read | write" pattern="EPS"/g' /etc/ImageMagick-6/policy.xml \ - && sed -i 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read | write" pattern="PDF"/g' /etc/ImageMagick-6/policy.xml \ - && sed -i 's/policy domain="coder" rights="none" pattern="XPS"/policy domain="coder" rights="read | write" pattern="XPS"/g' /etc/ImageMagick-6/policy.xml - -# -# Set the working directory. -# -WORKDIR /met - -RUN wget https://dtcenter.ucar.edu/dfiles/code/METplus/MET/installation/tar_files.tgz \ - && wget https://raw.githubusercontent.com/dtcenter/MET/develop/internal/scripts/installation/compile_MET_all.sh \ - && wget https://raw.githubusercontent.com/dtcenter/MET/develop/internal/scripts/environment/development.docker \ - && tar -zxf tar_files.tgz \ - && export SKIP_MET=yes \ - && chmod +x compile_MET_all.sh \ - && ./compile_MET_all.sh development.docker diff --git a/Dockerfile.debian_unit_test_env b/Dockerfile.debian_unit_test_env deleted file mode 100644 index 6938adb..0000000 --- a/Dockerfile.debian_unit_test_env +++ /dev/null @@ -1,26 +0,0 @@ -ARG MET_BASE_TAG - -FROM dtcenter/met-base:${MET_BASE_TAG} - -MAINTAINER John Halley Gotway - -# -# Set the working directory. -# -WORKDIR /met - -# -# Download and install MET and GhostScript fonts. -# Delete the MET source code for tagged releases matching "v"*. -# -RUN echo "Installing tools needed for running MET unit tests..." \ - && echo "Installing Perl XML Parser..." \ - && apt install -y libxml-parser-perl \ - && echo "Installing R..." \ - && apt install -y r-base \ - && echo "Installing R ncdf4 1.21..." \ - && wget https://cran.r-project.org/src/contrib/ncdf4_1.21.tar.gz \ - && R CMD INSTALL --configure-args="--with-nc-config=/usr/local/netcdf/netcdf-c-4.7.4/nc-config" ncdf4_1.21.tar.gz \ - && echo "Installing NCO and netcdf-bin (for ncdiff)..." \ - && apt install -y nco netcdf-bin \ - && echo "Finished installing unit test tools"