Skip to content

Commit 2ec51ae

Browse files
authored
Put together a docker image (#48)
1 parent 256efab commit 2ec51ae

File tree

6 files changed

+50
-7
lines changed

6 files changed

+50
-7
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@
22
The format is based on [Keep a Changelog](http://keepachangelog.com/)
33
and this project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## 1.x.x (Unreleased)
6+
- Add Dockerfile / Dockerhub images.
7+
58
## 1.0.0 (01/06/2018)
69
- Initial release!

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Set the base image
2+
FROM openjdk:8-jre-alpine
3+
4+
# Dockerfile author / maintainer
5+
MAINTAINER SourceLab.org <stephen.powis@gmail.com>
6+
7+
# Create app and data directories
8+
RUN mkdir -p /app
9+
WORKDIR /app
10+
11+
# Download latest distribution inside image
12+
# Extract package into /app stripping top level directory contained within the zip.
13+
RUN wget https://github.com/SourceLabOrg/kafka-webview/releases/download/v1.0.0/kafka-webview-ui-1.0.0-bin.zip && unzip -d /app kafka-webview-ui-*-bin.zip && rm -f /app/kafka-webview-ui-*-bin.zip && f=`ls` && mv /app/*/* /app && rmdir $f && rm -f /app/kafka-webview-ui-*-sources.jar && rm -f /app/kafka-webview-ui-*-javadoc.jar && apk add --update bash && rm -rf /var/cache/apk/*
14+
15+
# Create volume to persist data
16+
VOLUME /app/data
17+
18+
# Expose port
19+
EXPOSE 8080
20+
21+
# What to run when the container starts
22+
ENTRYPOINT [ "/app/start.sh" ]
23+

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This project aims to be a full-featured web-based [Apache Kafka](https://kafka.a
3030
#### Configuration
3131
![Configuration Screenshot](images/configuration.png)
3232

33-
## Installation ##
33+
## Installation from release distribution
3434

3535
Download the latest [release](https://github.com/SourceLabOrg/kafka-webview/releases) package and extract the ZIP file.
3636

@@ -60,9 +60,23 @@ app:
6060
### Starting the service
6161
6262
The Kafka WebView UI can be started by running the **start.sh** script from root of the extracted package.
63-
This should start a webserver running on the port you configured.
63+
This should start a webserver running on the port you configured. Point your browser at `http://your.host.name:8080` or the port that you configured and follow the [Logging in for the first time](#logging-in-for-the-first-time) instructions below.
6464

65-
### Logging in for the first time
65+
## Running from docker image
66+
67+
Docker images can be found on [Docker Hub](https://hub.docker.com/r/sourcelaborg/kafka-webview).
68+
69+
Start up the latest docker image by running `docker run -it -p 8080:8080 -v kafkawebview_data:/app/data sourcelaborg/kafka-webview:latest`
70+
71+
Point your browser at `http://localhost:8080` and follow the [Logging in for the first time](#logging-in-for-the-first-time) instructions below.
72+
73+
## Building from source
74+
75+
To build and run from the latest source code requires JDK 1.8 and Maven 3.3.9+. Clone this project and run the [buildAndRun.sh](https://github.com/SourceLabOrg/kafka-webview/blob/master/buildAndRun.sh) script to compile the project and start the service.
76+
77+
Point your browser at `http://localhost:8080` follow the [Logging in for the first time](#logging-in-for-the-first-time) instructions below.
78+
79+
## Logging in for the first time
6680

6781
On first start up a default Administrator user will be created for you. Login using `admin@example.com` with password `admin`
6882

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
## This are the required ENV variables for startup for development
1+
#!/bin/bash
22

3+
## These are the required ENV variables for startup for development
34
## Define what configs to load on start
45
export SPRING_CONFIG_LOCATION=classpath:/config/base.yml,classpath:/config/dev.yml
56

67
## What port to listen on
78
export PORT=8080
89

910
## run application via maven
10-
mvn -pl kafka-webview-ui spring-boot:run
11+
mvn -pl kafka-webview-ui spring-boot:run -DskipCheckStyle=true -DskipTests=true -DskipLicenseCheck=true

kafka-webview-ui/src/assembly/distribution/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/bin/sh
22

33
CWD=`pwd`
44

pom.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
<!-- test toggling -->
6060
<skipTests>false</skipTests>
6161
<skipCheckStyle>false</skipCheckStyle>
62+
<skipLicenseCheck>false</skipLicenseCheck>
6263
</properties>
6364

6465
<!-- Use Spring Boot Starter as Parent -->
@@ -138,8 +139,9 @@
138139
<configuration>
139140
<header>LICENSE.txt</header>
140141
<includes>
141-
**/**.java
142+
<include>**/**.java</include>
142143
</includes>
144+
<skip>${skipLicenseCheck}</skip>
143145
</configuration>
144146
<executions>
145147
<execution>

0 commit comments

Comments
 (0)