Skip to content

Commit

Permalink
build: the server DockerFile run command allows env variables (#3842)
Browse files Browse the repository at this point in the history
  • Loading branch information
agavra committed Nov 14, 2019
1 parent 32cf47b commit c2e42dc
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 15 deletions.
19 changes: 19 additions & 0 deletions config/ksqldb-server.properties.template
@@ -0,0 +1,19 @@
#
# Copyright 2019 Confluent Inc.
#
# Licensed under the Confluent Community License (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.confluent.io/confluent-community-license
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#

{% set kr_props = env_to_props('KSQL_', '') -%}
{% for name, value in kr_props.iteritems() -%}
{{name}}={{value}}
{% endfor -%}
15 changes: 0 additions & 15 deletions docker/README.md

This file was deleted.

4 changes: 4 additions & 0 deletions ksql-rest-app/Dockerfile
Expand Up @@ -8,5 +8,9 @@ ARG ARTIFACT_ID

ADD target/${ARTIFACT_ID}-${PROJECT_VERSION}-package/share/java/${ARTIFACT_ID}/* /usr/share/java/${ARTIFACT_ID}/
ADD target/${ARTIFACT_ID}-${PROJECT_VERSION}-package/bin/* /usr/bin/
ADD target/${ARTIFACT_ID}-${PROJECT_VERSION}-package/bin/docker/* /usr/bin/docker/
ADD target/${ARTIFACT_ID}-${PROJECT_VERSION}-package/etc/* /etc/ksql/
ADD target/${ARTIFACT_ID}-${PROJECT_VERSION}-package/share/doc/* /usr/share/doc/${ARTIFACT_ID}/

RUN chmod +x /usr/bin/docker/run
CMD ["/usr/bin/docker/run"]
7 changes: 7 additions & 0 deletions ksql-rest-app/src/assembly/package.xml
Expand Up @@ -48,6 +48,13 @@
<include>*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/include</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>docker/*</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
Expand Down
23 changes: 23 additions & 0 deletions ksql-rest-app/src/include/docker/run
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

#
# Copyright 2019 Confluent Inc.
#
# Licensed under the Confluent Community License (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.confluent.io/confluent-community-license
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#


echo "===> Configuring ksqlDB..."
dub template "/etc/ksql/ksqldb-server.properties.template" "/etc/ksql/ksqldb-server.properties"

echo "===> Launching ksqlDB Server..."
/usr/bin/ksql-server-start /etc/ksql/ksqldb-server.properties

0 comments on commit c2e42dc

Please sign in to comment.