You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2018/02/25 14:43:50 UTC

tinkerpop git commit: Add docker images for console and server TINKERPOP-1897

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1897 [created] 75c6f15c5


Add docker images for console and server TINKERPOP-1897


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/75c6f15c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/75c6f15c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/75c6f15c

Branch: refs/heads/TINKERPOP-1897
Commit: 75c6f15c5f9d543574a9b43e96a668feaa605f8e
Parents: d970564
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Sun Feb 25 15:42:23 2018 +0100
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Sun Feb 25 15:42:23 2018 +0100

----------------------------------------------------------------------
 .dockerignore                                   |  2 ++
 gremlin-console/Dockerfile                      | 31 +++++++++++++++++
 gremlin-console/pom.xml                         | 20 +++++++++++
 .../src/main/docker/docker-entrypoint.sh        | 24 ++++++++++++++
 gremlin-server/Dockerfile                       | 35 ++++++++++++++++++++
 gremlin-server/pom.xml                          | 20 +++++++++++
 .../src/main/docker/docker-entrypoint.sh        | 31 +++++++++++++++++
 pom.xml                                         |  5 +++
 8 files changed, 168 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/.dockerignore
----------------------------------------------------------------------
diff --git a/.dockerignore b/.dockerignore
index afe0e54..50d6801 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,5 +1,7 @@
 **/*.log
 **/target
+!gremlin-server/target/apache-tinkerpop-gremlin-server-*
+!gremlin-console/target/apache-tinkerpop-gremlin-console-*
 *.iml
 .idea
 **/*.DS_Store

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/gremlin-console/Dockerfile
----------------------------------------------------------------------
diff --git a/gremlin-console/Dockerfile b/gremlin-console/Dockerfile
new file mode 100644
index 0000000..b61f3e2
--- /dev/null
+++ b/gremlin-console/Dockerfile
@@ -0,0 +1,31 @@
+# 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:8u151-jre-alpine3.7
+
+ARG GREMLIN_CONSOLE_DIR
+
+RUN apk add --update \
+    bash \
+    && rm -rf /var/cache/apk/*
+
+COPY src/main/docker/docker-entrypoint.sh /
+COPY ${GREMLIN_CONSOLE_DIR} /opt/gremlin-console
+
+WORKDIR /opt/gremlin-console
+
+ENTRYPOINT [ "/docker-entrypoint.sh" ]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/gremlin-console/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-console/pom.xml b/gremlin-console/pom.xml
index 7c50ce5..b4227ca 100644
--- a/gremlin-console/pom.xml
+++ b/gremlin-console/pom.xml
@@ -218,6 +218,26 @@ limitations under the License.
                     </execution>
                 </executions>
             </plugin>
+            <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>dockerfile-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                    <id>default</id>
+                    <goals>
+                        <goal>build</goal>
+                        <goal>push</goal>
+                    </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <repository>tinkerpop/gremlin-console</repository>
+                    <tag>${project.version}</tag>
+                    <buildArgs>
+                        <GREMLIN_CONSOLE_DIR>target/apache-tinkerpop-${project.artifactId}-${project.version}-standalone</GREMLIN_CONSOLE_DIR>
+                    </buildArgs>
+                </configuration>
+            </plugin>
         </plugins>
     </build>
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/gremlin-console/src/main/docker/docker-entrypoint.sh
----------------------------------------------------------------------
diff --git a/gremlin-console/src/main/docker/docker-entrypoint.sh b/gremlin-console/src/main/docker/docker-entrypoint.sh
new file mode 100644
index 0000000..2c8d204
--- /dev/null
+++ b/gremlin-console/src/main/docker/docker-entrypoint.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+set -e
+
+exec /opt/gremlin-console/bin/gremlin.sh "$@"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/gremlin-server/Dockerfile
----------------------------------------------------------------------
diff --git a/gremlin-server/Dockerfile b/gremlin-server/Dockerfile
new file mode 100644
index 0000000..2e14e41
--- /dev/null
+++ b/gremlin-server/Dockerfile
@@ -0,0 +1,35 @@
+# 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:8u151-jre-alpine3.7
+
+ARG GREMLIN_SERVER_DIR
+
+RUN apk add --update \
+    bash \
+    perl \
+    && rm -rf /var/cache/apk/*
+
+COPY src/main/docker/docker-entrypoint.sh /
+COPY ${GREMLIN_SERVER_DIR} /opt/gremlin-server
+
+WORKDIR /opt/gremlin-server
+
+EXPOSE 8182
+
+ENTRYPOINT [ "/docker-entrypoint.sh" ]
+CMD ["conf/gremlin-server.yaml"]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/gremlin-server/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-server/pom.xml b/gremlin-server/pom.xml
index 5a8d725..bf3142e 100644
--- a/gremlin-server/pom.xml
+++ b/gremlin-server/pom.xml
@@ -152,6 +152,26 @@ limitations under the License.
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>com.spotify</groupId>
+                <artifactId>dockerfile-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                    <id>default</id>
+                    <goals>
+                        <goal>build</goal>
+                        <goal>push</goal>
+                    </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <repository>tinkerpop/gremlin-server</repository>
+                    <tag>${project.version}</tag>
+                    <buildArgs>
+                        <GREMLIN_SERVER_DIR>target/apache-tinkerpop-${project.artifactId}-${project.version}-standalone</GREMLIN_SERVER_DIR>
+                    </buildArgs>
+                </configuration>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
             </plugin>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/gremlin-server/src/main/docker/docker-entrypoint.sh
----------------------------------------------------------------------
diff --git a/gremlin-server/src/main/docker/docker-entrypoint.sh b/gremlin-server/src/main/docker/docker-entrypoint.sh
new file mode 100644
index 0000000..d869b8c
--- /dev/null
+++ b/gremlin-server/src/main/docker/docker-entrypoint.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+#
+#
+# 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.
+#
+
+set -e
+
+CONF_FILE=$1
+
+# IP substitution hack borrowed from:
+# https://github.com/htaox/NEAT/blob/94a004831cf89767e116d955192fc14ac82e5069/docker-scripts/gremlin-server-3.0.0/files/default_cmd#L5
+IP=$(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }')
+sed -i "s|^host:.*|host: $IP|" $CONF_FILE
+
+exec /opt/gremlin-server/bin/gremlin-server.sh "$@"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75c6f15c/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 259f16a..0d25b96 100644
--- a/pom.xml
+++ b/pom.xml
@@ -490,6 +490,11 @@ limitations under the License.
                     <artifactId>maven-jar-plugin</artifactId>
                     <version>3.0.2</version>
                 </plugin>
+                <plugin>
+                    <groupId>com.spotify</groupId>
+                    <artifactId>dockerfile-maven-plugin</artifactId>
+                    <version>1.3.7</version>
+                </plugin>
             </plugins>
         </pluginManagement>
     </build>