Skip to content

Commit

Permalink
Adds elasticsearch6 and elasticsearch7 images
Browse files Browse the repository at this point in the history
These are used in our integration tests for zipkin-storage/elasticsearch

See openzipkin-attic/docker-zipkin#86
  • Loading branch information
Adrian Cole committed Oct 17, 2019
1 parent 7d81636 commit b0a2b7e
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ integration tests. We designed these to be small and start easily. We did this b
base layer `openzipkin/zipkin`, and setting up schema where relevant.

* [zipkin-cassandra](cassandra/README.md) - runs Cassandra initialized with Zipkin's schema
* [zipkin-elasticsearch6](elasticsearch6/README.md) - runs Elasticsearch 6.x
* [zipkin-elasticsearch7](elasticsearch7/README.md) - runs Elasticsearch 7.x
* [zipkin-kafka](kafka/README.md) - runs both Kafka+ZooKeeper
* [zipkin-ui](lens/README.md) - serves the (Lens) UI directly with NGINX

Expand Down
47 changes: 47 additions & 0 deletions docker/elasticsearch6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# Copyright 2015-2019 The OpenZipkin Authors
#
# 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 alpine

ENV ELASTICSEARCH_VERSION 6.8.3

RUN apk add --update curl

WORKDIR /elasticsearch

RUN curl -sSL https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION.tar.gz| tar xz && \
mv elasticsearch-$ELASTICSEARCH_VERSION/* /elasticsearch/

FROM openzipkin/jre-full:11.0.4-11.33
LABEL MAINTAINER Zipkin "https://zipkin.io/"

# https://github.com/elastic/elasticsearch/pull/31003 was closed won't fix
ENV ES_TMPDIR /tmp

RUN ["/busybox/sh", "-c", "adduser -g '' -h /elasticsearch -D elasticsearch"]

COPY --from=0 --chown=elasticsearch /elasticsearch /elasticsearch

WORKDIR /elasticsearch

# elasticsearch complains if run as root
USER elasticsearch

COPY config ./config

EXPOSE 9200 9300

ENV JAVA_OPTS " "

ENTRYPOINT ["/busybox/sh", "/elasticsearch/bin/elasticsearch"]
21 changes: 21 additions & 0 deletions docker/elasticsearch6/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## zipkin-elasticsearch6 Docker image

The `zipkin-elasticsearch6` testing image runs Elasticsearch 6.x for [Elasticsearch storage](../../zipkin-storage/elasticsearch)
integration.

To build `openzipkin/zipkin-elasticsearch6`, from the top level of the repository, run:
```bash
$ docker build -t openzipkin/zipkin-elasticsearch6:test -f docker/elasticsearch6/Dockerfile .
```

#### Host setup
Elasticsearch is [strict](https://github.com/docker-library/docs/tree/master/elasticsearch#host-setup)
about virtual memory. You will need to adjust accordingly (especially if you notice Elasticsearch crash!)

```bash
# If docker is running on your host machine, adjust the kernel setting directly
$ sudo sysctl -w vm.max_map_count=262144

# If using docker-machine/Docker Toolbox/Boot2Docker, remotely adjust the same
$ docker-machine ssh default "sudo sysctl -w vm.max_map_count=262144"
```
17 changes: 17 additions & 0 deletions docker/elasticsearch6/config/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright 2015-2019 The OpenZipkin Authors
#
# 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.
#

network.host: 0.0.0.0
discovery.zen.minimum_master_nodes: 1
xpack.ml.enabled: false
49 changes: 49 additions & 0 deletions docker/elasticsearch7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#
# Copyright 2015-2019 The OpenZipkin Authors
#
# 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 alpine

ENV ELASTICSEARCH_VERSION 7.4.0

RUN apk add --update curl

WORKDIR /elasticsearch

RUN curl -sSL https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ELASTICSEARCH_VERSION-linux-x86_64.tar.gz| tar xz && \
mv elasticsearch-$ELASTICSEARCH_VERSION/* /elasticsearch/ && \
# disable ML as not supported on alpine per https://discuss.elastic.co/t/elasticsearch-failing-to-start-due-to-x-pack/85125/6
rm -rf /elasticsearch/modules/x-pack-ml/platform/linux-x86_64

FROM openzipkin/jre-full:11.0.4-11.33
LABEL MAINTAINER Zipkin "https://zipkin.io/"

# https://github.com/elastic/elasticsearch/pull/31003 was closed won't fix
ENV ES_TMPDIR /tmp

RUN ["/busybox/sh", "-c", "adduser -g '' -h /elasticsearch -D elasticsearch"]

COPY --from=0 --chown=elasticsearch /elasticsearch /elasticsearch

WORKDIR /elasticsearch

# elasticsearch complains if run as root
USER elasticsearch

COPY config ./config

EXPOSE 9200 9300

ENV JAVA_OPTS " "

ENTRYPOINT ["/busybox/sh", "/elasticsearch/bin/elasticsearch"]
21 changes: 21 additions & 0 deletions docker/elasticsearch7/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## zipkin-elasticsearch7 Docker image

The `zipkin-elasticsearch7` testing image runs Elasticsearch 7.x for [Elasticsearch storage](../../zipkin-storage/elasticsearch)
integration.

To build `openzipkin/zipkin-elasticsearch7`, from the top level of the repository, run:
```bash
$ docker build -t openzipkin/zipkin-elasticsearch7:test -f docker/elasticsearch7/Dockerfile .
```

#### Host setup
Elasticsearch is [strict](https://github.com/docker-library/docs/tree/master/elasticsearch#host-setup)
about virtual memory. You will need to adjust accordingly (especially if you notice Elasticsearch crash!)

```bash
# If docker is running on your host machine, adjust the kernel setting directly
$ sudo sysctl -w vm.max_map_count=262144

# If using docker-machine/Docker Toolbox/Boot2Docker, remotely adjust the same
$ docker-machine ssh default "sudo sysctl -w vm.max_map_count=262144"
```
20 changes: 20 additions & 0 deletions docker/elasticsearch7/config/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright 2015-2019 The OpenZipkin Authors
#
# 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.
#

network.host: 0.0.0.0
node.name: zipkin-elasticsearch
cluster.name: "docker-cluster"
cluster.initial_master_nodes:
- zipkin-elasticsearch
xpack.ml.enabled: false
24 changes: 24 additions & 0 deletions docker/elasticsearch7/config/log4j2.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#
# Copyright 2015-2019 The OpenZipkin Authors
#
# 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.
#

status = error

appender.console.type = Console
appender.console.name = console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n

rootLogger.level = info
rootLogger.appenderRef.console.ref = console

2 changes: 1 addition & 1 deletion docker/hooks/post_build
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ for tag in ${TAGS[@]:1}; do
done

# We also build testing images to correspond with the server version to keep schemas up to date
for path in storage/cassandra kafka; do
for path in storage/cassandra storage/elasticsearch6 storage/elasticsearch7 kafka; do
image=$(basename ${path})
echo Building ${image}
docker build --build-arg version="$SOURCE_BRANCH" -f "docker/${path}/Dockerfile" -t "openzipkin/${image}:${TAGS[0]}" .
Expand Down
2 changes: 1 addition & 1 deletion docker/hooks/post_push
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ "$DOCKER_REPO" == "index.docker.io/openzipkin/zipkin" ]]; then
docker push "openzipkin/zipkin-ui:$tag"
docker push "openzipkin/zipkin-kafka:$tag"

for storage in cassandra; do
for storage in cassandra elasticsearch6 elasticsearch7; do
docker push "openzipkin/zipkin-${storage}:$tag"
done
done
Expand Down
2 changes: 1 addition & 1 deletion docker/kafka/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## zipkin-kafka Docker image

The `zipkin-kafka` testing image runs both Kafka+ZooKeeper for the [Kafka collector](https://github.com/openzipkin/zipkin/tree/master/zipkin-collector/kafka)
The `zipkin-kafka` testing image runs both Kafka+ZooKeeper for the [Kafka collector](../../zipkin-collector/kafka)
and the upcoming [Kafka storage](https://github.com/openzipkin-contrib/zipkin-storage-kafka).

To build `openzipkin/zipkin-kafka`, from the top level of the repository, run:
Expand Down

0 comments on commit b0a2b7e

Please sign in to comment.