Adds Dockerfile for CLI.
ADD
cli/Dockerfile
+FROM openjdk:8 AS build
+
+ARG CLI_VERSION="0.3.0"
+ARG RELEASE_TYPE="tag"
+
+COPY files /tmp
+RUN chmod +x /tmp/fetch-source.sh && \
+ /tmp/fetch-source.sh ${CLI_VERSION} ${RELEASE_TYPE}
+
+WORKDIR /tmp/apiman-cli
+RUN chmod +x /tmp/apiman-cli/gradlew && \
+ ./gradlew shadowJar
+
+FROM openjdk:8-jre-alpine
+
+RUN mkdir -p /opt/apiman-cli/lib
+COPY --from=build /tmp/apiman-cli/build/libs/* /opt/apiman-cli/lib/
+
+ENTRYPOINT [ "java", "-jar", "/opt/apiman-cli/lib/apiman-cli.jar" ]

ADD
cli/README.md
+apiman cli
+==========
+
+## Usage
+
+To use apiman CLI
+
+ docker run -it apiman/cli [args]
+
+For valid arguments, please see the documentation for [apiman CLI](https://github.com/apiman/apiman-cli)
+
+## Building the image
+
+ docker build -t="apiman/cli" --rm .
+
+### Building from a branch
+
+If you're a developer working on this project, or you want the latest edge version, you can build from a branch of the apiman-cli repository.
+
+To do this, specify the RELEASE_TYPE as 'branch' and the CLI_VERSION as the branch name:
+
+ docker build -t="apiman/cli:beta" --build-arg RELEASE_TYPE=branch --build-arg CLI_VERSION="develop" --rm .
+
+## Image accessible on Docker hub
+
+This image is automatically built and published into [Docker Hub](https://registry.hub.docker.com/u/apiman/cli/).

ADD
cli/files/fetch-source.sh
+#!/usr/bin/env bash
+
+set -e
+
+if [[ $# -lt 2 ]]; then
+ echo "Usage: $( basename $0 ) <CLI_VERSION> <RELEASE_TYPE>"
+ exit 1
+fi
+
+CLI_VERSION="$1"
+RELEASE_TYPE="$2"
+
+case "${RELEASE_TYPE}" in
+ tag)
+ SOURCE_URL="https://codeload.github.com/apiman/apiman-cli/zip/v${CLI_VERSION}"
+ ;;
+ branch)
+ SOURCE_URL="https://codeload.github.com/apiman/apiman-cli/zip/${CLI_VERSION}"
+ ;;
+ *)
+ echo "Release type must be branch or tag"
+ exit 1
+ ;;
+esac
+
+echo -e "Downloading source from: ${SOURCE_URL}"
+curl -s ${SOURCE_URL} -o /tmp/apiman-cli.zip
+
+unzip /tmp/apiman-cli.zip -d /tmp
+mv /tmp/apiman-cli-* /tmp/apiman-cli

Adds Dockerfile for CLI.