Skip to content

Commit

Permalink
Per #1546, added Dockerfile that copies local MET source code into Do…
Browse files Browse the repository at this point in the history
…cker image instead of cloning the repository
  • Loading branch information
georgemccabe committed Jan 20, 2022
1 parent d07fcb0 commit 5cd2afb
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions scripts/docker/Dockerfile.copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ARG MET_BASE_IMAGE=minimum

FROM dtcenter/met-base:${MET_BASE_IMAGE}
MAINTAINER John Halley Gotway <[email protected]>

#
# 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

0 comments on commit 5cd2afb

Please sign in to comment.