This is an automated email from the ASF dual-hosted git repository.
hxd pushed a commit to branch rel/0.9
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/rel/0.9 by this push:
new eb316e3 Feature/docker for iotdb grafana (#1148)
eb316e3 is described below
commit eb316e324b54623bb2680247a0bdd369b24ea3e4
Author: Julian <[email protected]>
AuthorDate: Wed May 6 08:01:03 2020 +0200
Feature/docker for iotdb grafana (#1148)
* Added Docker Support for iotdb-grafana Adapter.
---
grafana/Dockerfile | 29 +++++++++++++++++++++++++++++
grafana/README_DOCKER.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
diff --git a/grafana/Dockerfile b/grafana/Dockerfile
new file mode 100644
index 0000000..255cda1
--- /dev/null
+++ b/grafana/Dockerfile
@@ -0,0 +1,29 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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 openjdk:11-jre-slim
+LABEL maintainer="[email protected]"
+RUN mkdir /iotdb
+
+ADD target/iotdb-grafana-*.war /iotdb/iotdb-grafana.war
+ADD src/main/resources/application.properties /iotdb/
+
+EXPOSE 8888
+
+WORKDIR /iotdb/
+ENTRYPOINT ["java",
"-Dspring.datasource.url=jdbc:iotdb://${IOTDB_HOST}:${IOTDB_PORT}",
"-Dspring.datasource.username=${IOTDB_USER}",
"-Dspring.datasource.password=${IOTDB_PASSWORD}", "-jar",
"/iotdb/iotdb-grafana.war"]
diff --git a/grafana/README_DOCKER.md b/grafana/README_DOCKER.md
new file mode 100644
index 0000000..74de37a
--- /dev/null
+++ b/grafana/README_DOCKER.md
@@ -0,0 +1,48 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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.
+
+-->
+# Docker Container for IoTDB Grafana Adapter
+
+## Build
+
+* `mvn clean package`
+* in the module root execute `docker image build -t
apache/iotdb-grafana:{version} .` where version is e.g. 0.9.3.
+* Optionally push (if you are logged in) with `docker push
jfeinauer/iotdb-grafana:{version}`.
+
+## Execute
+
+Needed Environment Parameters are:
+
+* IOTDB_HOST
+* IOTDB_PORT
+* IOTDB_USER
+* IOTDB_PASSWORD
+
+First, start a container for iotdb:
+
+```
+docker run -d -p 6667:6667 -p 31999:31999 -p 8181:8181 --name some-iotdb
apache/iotdb:0.9.1-jre8
+```
+
+then you can start the adapter via
+
+```
+docker run -d --link some-iotdb -e IOTDB_HOST=some-iotdb -e IOTDB_PORT=6667 -e
IOTDB_USER=root -e IOTDB_PASSWORD=root --name iotdb-grafana
apache/iotdb-grafana:0.9.3
+```
\ No newline at end of file