From 06fe13c4bf575fa8190a96cef432309aea90f566 Mon Sep 17 00:00:00 2001 From: Bodo Schulz Date: Thu, 14 Jul 2016 06:39:14 +0200 Subject: [PATCH] update README.md add Makefile --- Makefile | 35 +++++++++++++++++++++++++++++++++ README.md | 59 +++++++++++++++++++++++++++++++------------------------ build.sh | 7 ------- config.rc | 7 ------- run.sh | 22 --------------------- 5 files changed, 68 insertions(+), 62 deletions(-) create mode 100644 Makefile delete mode 100755 build.sh delete mode 100644 config.rc delete mode 100755 run.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..190aeef --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +TYPE := jolokia +IMAGE_NAME := ${USER}-docker-${TYPE} + + +build: + docker build --rm --tag=$(IMAGE_NAME) . + +run: + docker run \ + --detach \ + --interactive \ + --tty \ + --hostname=${USER}-mysql \ + --name=${USER}-${TYPE} \ + $(IMAGE_NAME) + +shell: + docker run \ + --rm \ + --interactive \ + --tty \ + --hostname=${USER}-mysql \ + --name=${USER}-${TYPE} \ + $(IMAGE_NAME) + +exec: + docker exec \ + --interactive \ + --tty \ + ${USER}-${TYPE} \ + /bin/sh + +stop: + docker kill \ + ${USER}-${TYPE} diff --git a/README.md b/README.md index ee17e83..40c89d5 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,49 @@ -# docker-jolokia +docker-jolokia +============== Minimal Image with Apache Tomcat8, openjdk8-jre-base and jolokia. -## versions +# Status +[![Build Status](https://travis-ci.org/bodsch/docker-jolokia.svg?branch=master)](https://travis-ci.org/bodsch/docker-jolokia) - - tomcat 8.5.2 - - jolokia 1.3.3 - - openjdk from alpine +# Build + +Your can use the included Makefile. + +To build the Container: +```make build``` + +Starts the Container: +```make run``` + +Starts the Container with Login Shell: +```make shell``` -## Build +Entering the Container: +```make exec``` - ``` - docker build --tag=docker-jolokia . - ``` - or +Stop (but **not kill**): +```make stop``` - ``` - ./build.sh - ``` +# Docker Hub -## run +You can find the Container also at [DockerHub](https://hub.docker.com/r/bodsch/docker-jolokia/) + + +# Versions + + - tomcat 8.5.4 + - jolokia 1.3.3 + - openjdk from alpine - ``` - docker run docker-jolokia - ``` - or +``` - ``` - ./run.sh - ``` +# Test -## Test + curl http://localhost:8080/jolokia/ | python -mjson.tool - ``` - curl http://localhost:8080/jolokia/ | python -mjson.tool - ``` -## Ports +# Ports * 8080 diff --git a/build.sh b/build.sh deleted file mode 100755 index 8281d51..0000000 --- a/build.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -. config.rc - -docker build --tag=${TAG_NAME} . - -# EOF diff --git a/config.rc b/config.rc deleted file mode 100644 index 8cd6147..0000000 --- a/config.rc +++ /dev/null @@ -1,7 +0,0 @@ -# - -TYPE="jolokia" - -TAG_NAME="${USER}-docker-${TYPE}" -CONTAINER_NAME="${USER}-${TYPE}" - diff --git a/run.sh b/run.sh deleted file mode 100755 index 1f8b9eb..0000000 --- a/run.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -. config.rc - -if [ $(docker ps -a | grep ${CONTAINER_NAME} | awk '{print $NF}' | wc -l) -gt 0 ] -then - docker kill ${CONTAINER_NAME} 2> /dev/null - docker rm ${CONTAINER_NAME} 2> /dev/null -fi - -# --------------------------------------------------------------------------------------- - -docker run \ - --interactive \ - --tty \ - --detach \ - --hostname ${USER}-${TYPE} \ - --name ${CONTAINER_NAME} \ - ${TAG_NAME} - -# --------------------------------------------------------------------------------------- -# EOF