Skip to content

Commit

Permalink
add a Docker build folder with makefile (#23)
Browse files Browse the repository at this point in the history
add a Docker build folder with makefile
  • Loading branch information
coffeepac authored and lindong28 committed Oct 7, 2016
1 parent 5448343 commit 34592a7
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.gradle/
.DS_Store
build/
logs/
30 changes: 30 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


FROM anapsix/alpine-java

MAINTAINER [email protected]

WORKDIR /opt/kafka-monitor
ADD build/ build/
ADD core/build/ core/build/
ADD services/build/ services/build/
ADD tests/build/ tests/build/
ADD bin/kafka-monitor-start.sh bin/kafka-monitor-start.sh
ADD bin/kmf-run-class.sh bin/kmf-run-class.sh
ADD config/kafka-monitor.properties config/kafka-monitor.properties
ADD config/log4j.properties config/log4j.properties
ADD docker/kafka-monitor-docker-entry.sh kafka-monitor-docker-entry.sh
ADD webapp/ webapp/

CMD ["/opt/kafka-monitor/kafka-monitor-docker-entry.sh"]
28 changes: 28 additions & 0 deletions docker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

all: push

TAG ?= 0.1
PREFIX ?= quay.io/samsung_cnct/kafka-monitor

container:
cd ../ && \
docker build -t $(PREFIX):$(TAG) -f docker/Dockerfile .

push: container
docker push $(PREFIX):$(TAG)

clean:
docker rmi $(PREFIX):$(TAG)
33 changes: 33 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Kafka Monitor Docker build
This build process assumes that you have already built the application
using gradlew as specified in the parent README. If you haven't, this
build will error out complaining of missing files.

## Getting Started

### Build the container locally
Decide where you would like the built container to be stored. The
default is quay.io/coffeepac/kafak-monitor. You can probably not
write to this location so you should specifiy a new location either
at the command line or in an environment variable

Using default tag/repo location
```
make container
```

Using command line flags
```
make container -e TAG=0.2
```

Using environment variables
```
export PREFIX=quay.io/your_userid/kafka-monitor
make container
```

### Push container to remote repository
```
make push
```
21 changes: 21 additions & 0 deletions docker/kafka-monitor-docker-entry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


set -x

# wait for DNS services to be available
sleep 10

bin/kafka-monitor-start.sh config/kafka-monitor.properties

0 comments on commit 34592a7

Please sign in to comment.