From 5cd2afba7b88e54235bd90f3e36380639718e6cd Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Wed, 19 Jan 2022 17:09:56 -0700 Subject: [PATCH] Per #1546, added Dockerfile that copies local MET source code into Docker image instead of cloning the repository --- scripts/docker/Dockerfile.copy | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 scripts/docker/Dockerfile.copy diff --git a/scripts/docker/Dockerfile.copy b/scripts/docker/Dockerfile.copy new file mode 100644 index 0000000000..c5a9311d07 --- /dev/null +++ b/scripts/docker/Dockerfile.copy @@ -0,0 +1,45 @@ +ARG MET_BASE_IMAGE=minimum + +FROM dtcenter/met-base:${MET_BASE_IMAGE} +MAINTAINER John Halley Gotway + +# +# This Dockerfile checks out MET from GitHub and compiles the specified branch or tag from source. +# +ARG SOURCE_BRANCH + +# +# SOURCE_BRANCH is not defined when built via Docker Hub. +# +RUN if [ "x${SOURCE_BRANCH}" = "x" ]; then \ + echo "ERROR: SOURCE_BRANCH undefined! Rebuild with \"--build-arg SOURCE_BRANCH={branch name}\""; \ + exit 1; \ + else \ + echo "Build Argument SOURCE_BRANCH=${SOURCE_BRANCH}"; \ + fi + +ENV MET_GIT_NAME ${SOURCE_BRANCH} +ENV MET_GIT_URL https://github.com/dtcenter/MET +ENV MET_DEVELOPMENT true + +# +# 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 "Copying MET into /met/MET-${MET_GIT_NAME}" \ + && mkdir -p /met/MET-${MET_GIT_NAME} + +COPY . /met/MET-${MET_GIT_NAME} + +RUN if [ ! -e "/met/MET-${MET_GIT_NAME}/met/configure.ac" ]; then \ + echo "ERROR: docker build must be run from the MET directory"; \ + exit 1; \ + fi + +RUN cd /met/MET-${MET_GIT_NAME}/met \ + && ./scripts/docker/build_met_docker.sh