Skip to content

Commit 43f88ea

Browse files
docker: add pulsar example (#3789)
Since there is no collector-pulsar module at present, compiling docker will result in an error, so when this PR is merged, I will add `zipkin-collector-pulsar` to the github actions in #3788.
1 parent d018d74 commit 43f88ea

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

.github/workflows/test_readme.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,9 @@ jobs:
181181
build-bin/docker/docker_test_image openzipkin/zipkin-rabbitmq:test
182182
env:
183183
DOCKER_FILE: docker/test-images/zipkin-rabbitmq/Dockerfile
184+
- name: docker/test-images/zipkin-pulsar/README.md
185+
run: |
186+
build-bin/docker/docker_build openzipkin/zipkin-pulsar:test &&
187+
build-bin/docker/docker_test_image openzipkin/zipkin-pulsar:test
188+
env:
189+
DOCKER_FILE: docker/test-images/zipkin-pulsar/Dockerfile

docker/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ base layer `openzipkin/zipkin`, and setting up schema where relevant.
2222
* [ghcr.io/openzipkin/zipkin-eureka](test-images/zipkin-eureka/README.md) - runs Eureka
2323
* [ghcr.io/openzipkin/zipkin-kafka](test-images/zipkin-kafka/README.md) - runs both Kafka+ZooKeeper
2424
* [ghcr.io/openzipkin/zipkin-mysql](test-images/zipkin-mysql/README.md) - runs MySQL initialized with Zipkin's schema
25+
* [ghcr.io/openzipkin/zipkin-pulsar](test-images/zipkin-pulsar/README.md) - runs Pulsar
2526
* [ghcr.io/openzipkin/zipkin-rabbitmq](test-images/zipkin-rabbitmq/README.md) - runs RabbitMQ
2627
* [ghcr.io/openzipkin/zipkin-ui](test-images/zipkin-ui/README.md) - serves the (Lens) UI directly with NGINX
2728

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# Copyright The OpenZipkin Authors
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
6+
# Use latest from https://hub.docker.com/r/apachepulsar/pulsar/tags
7+
ARG pulsar_version=4.0.2
8+
9+
# We copy files from the context into a scratch container first to avoid a problem where docker and
10+
# docker compose don't share layer hashes https://github.com/docker/compose/issues/883 normally.
11+
# COPY --from= works around the issue.
12+
FROM scratch as scratch
13+
14+
WORKDIR /docker-bin
15+
COPY build-bin/docker/docker-healthcheck /docker-bin/
16+
17+
ARG pulsar_version
18+
19+
FROM apachepulsar/pulsar:${pulsar_version} as zipkin-pulsar
20+
LABEL pulsar-version=$pulsar_version
21+
LABEL org.opencontainers.image.description="Apache Pulsar on Alpine Linux"
22+
23+
# Add HEALTHCHECK and ENTRYPOINT scripts into the default search path
24+
COPY --from=scratch /docker-bin/* /usr/local/bin/
25+
# We use start period of 30s to avoid marking the container unhealthy on slow or contended CI hosts
26+
HEALTHCHECK --interval=1s --start-period=30s --timeout=5s CMD ["docker-healthcheck"]
27+
28+
# Usually, we read env set from pid 1 to get docker-healthcheck parameters.
29+
# However, pulsar-server has to start as root even if permissions are dropped
30+
# later. So, we expose it in the Dockerfile instead.
31+
ENV HEALTHCHECK_PORT=8080
32+
ENV HEALTHCHECK_KIND=http
33+
ENV HEALTHCHECK_PATH=/admin/v2/clusters/standalone
34+
ENV PULSAR_LOG_ROOT_LEVEL=WARN
35+
EXPOSE 8080 6650
36+
CMD ["bin/pulsar", "standalone"]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## zipkin-pulsar Docker image
2+
3+
The `zipkin-pulsar` testing image runs Pulsar for Pulsar collector integration.
4+
5+
To build `openzipkin/zipkin-pulsar:test`, from the top-level of the repository, run:
6+
```bash
7+
$ DOCKER_FILE=docker/test-images/zipkin-pulsar/Dockerfile build-bin/docker/docker_build openzipkin/zipkin-pulsar:test
8+
```
9+
10+
You can use the env variable `PULSAR_LOG_ROOT_LEVEL` to change the log level for Pulsar. Defaults to "WARN".

0 commit comments

Comments
 (0)