Skip to content

Commit

Permalink
fix docker image not have cpp client installed (apache#4986)
Browse files Browse the repository at this point in the history
  • Loading branch information
freeznet authored and sijie committed Aug 21, 2019
1 parent e8b4edd commit 4cf3516
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docker/pulsar/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ RUN pip install kazoo pyyaml
RUN python3.5 get-pip.py

ADD target/python-client/ /pulsar/pulsar-client
ADD target/cpp-client/ /pulsar/cpp-client
RUN /pulsar/bin/install-pulsar-client-27.sh
RUN /pulsar/bin/install-pulsar-client-35.sh
RUN echo networkaddress.cache.ttl=1 >> $JAVA_HOME/jre/lib/security/java.security
RUN apt-get update \
&& apt install -y /pulsar/cpp-client/*.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /pulsar

Expand Down
28 changes: 28 additions & 0 deletions docker/pulsar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,26 @@
</arguments>
</configuration>
</execution>
<execution>
<id>build-pulsar-cpp-client-deb</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<skip>${skipBuildCppClient}</skip>
<workingDirectory>${project.basedir}/target</workingDirectory>
<executable>${project.basedir}/../../pulsar-client-cpp/pkg/deb/docker-build-deb.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>copy-pulsar-clients-python</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
Expand All @@ -105,6 +118,21 @@
</tasks>
</configuration>
</execution>
<execution>
<id>copy-pulsar-cpp-client</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<skip>${skipCopyCppClient}</skip>
<tasks>
<echo>copy cpp client deb file</echo>
<mkdir dir="${basedir}/target/cpp-client"/>
<copydir src="${basedir}/../../pulsar-client-cpp/pkg/deb/BUILD/DEB" dest="${basedir}/target/cpp-client"/>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
2 changes: 1 addition & 1 deletion pulsar-client-cpp/pkg/deb/docker-build-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ ROOT_DIR=$(git rev-parse --show-toplevel)

docker pull apachepulsar/pulsar-build:debian-9

docker run -it -v $ROOT_DIR:/pulsar apachepulsar/pulsar-build:debian-9 \
docker run -i -v $ROOT_DIR:/pulsar apachepulsar/pulsar-build:debian-9 \
/pulsar/pulsar-client-cpp/pkg/deb/build-deb.sh

0 comments on commit 4cf3516

Please sign in to comment.