Skip to content

Commit

Permalink
docker: fixes native library config (#3738)
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Cole <adrian@tetrate.io>
  • Loading branch information
codefromthecrypt committed Feb 26, 2024
1 parent c65ce5c commit 09c523d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test_readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,17 @@ jobs:
- name: docker/README.md - openzipkin/zipkin
run: |
build-bin/docker/docker_build openzipkin/zipkin:test &&
build-bin/docker/docker_test_image openzipkin/zipkin:test
build-bin/docker/docker_test_image openzipkin/zipkin:test &&
docker run --rm --entrypoint=/bin/sh openzipkin/zipkin:test \
-c 'cd BOOT-INF/lib && du -sk *aarch* *x86* *a64*' || true
env:
RELEASE_FROM_MAVEN_BUILD: true
- name: docker/README.md - openzipkin/zipkin-slim
run: |
build-bin/docker/docker_build openzipkin/zipkin-slim:test &&
build-bin/docker/docker_test_image openzipkin/zipkin-slim:test
build-bin/docker/docker_test_image openzipkin/zipkin-slim:test &&
docker run --rm --entrypoint=/bin/sh openzipkin/zipkin-slim:test \
-c 'cd BOOT-INF/lib && du -sk *aarch* *x86* *a64*' || true
env:
DOCKER_TARGET: zipkin-slim
RELEASE_FROM_MAVEN_BUILD: true
Expand Down
12 changes: 10 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,18 @@ ENV RELEASE_FROM_MAVEN_BUILD=$release_from_maven_build
ARG version=master
ENV VERSION=$version
ENV MAVEN_PROJECT_BASEDIR=/code
RUN /code/build-bin/maven/maven_build_or_unjar io.zipkin zipkin-server ${VERSION} exec && \
ARG TARGETARCH
RUN test "${TARGETARCH}" != "" && \
/code/build-bin/maven/maven_build_or_unjar io.zipkin zipkin-server ${VERSION} exec && \
mv zipkin-server zipkin && \
/code/build-bin/maven/maven_build_or_unjar io.zipkin zipkin-server ${VERSION} slim && \
mv zipkin-server zipkin-slim
mv zipkin-server zipkin-slim && \
# Copy tcnative deps to slim: 1.1MB more libs when pared to current platform.
cp zipkin/BOOT-INF/lib/*tcnative*.jar zipkin-slim/BOOT-INF/lib/ && \
# Remove any unused platform-specific jars. This results in none for s390x or non-linux.
rm */BOOT-INF/lib/*windows* */BOOT-INF/lib/*osx* && \
if [ "${TARGETARCH}" != "amd64" ]; then rm */BOOT-INF/lib/*x86*; fi && \
if [ "${TARGETARCH}" != "arm64" ]; then rm */BOOT-INF/lib/*a64* */BOOT-INF/lib/*aarch*; fi

# Almost everything is common between the slim and normal build
FROM ghcr.io/openzipkin/java:${java_version}-jre as base-server
Expand Down
9 changes: 6 additions & 3 deletions zipkin-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@
<classifier>slim</classifier>
<!-- https://github.com/spring-projects/spring-boot/issues/3426 transitive exclude doesn't work -->
<excludeGroupIds>
com.google.auto.value,com.google.guava,io.dropwizard.metrics,com.datastax.oss,com.github.jnr,org.ow2.asm,org.jooq,javax.xml.bind,org.mariadb.jdbc,com.zaxxer,org.apache.activemq,org.apache.geronimo.specs,org.fusesource.hawtbuf,org.apache.kafka,com.github.luben,org.lz4,org.xerial.snappy,com.rabbitmq,jakarta.annotation,org.apache.thrift,org.apache.logging.log4j
com.google.auto.value,com.google.guava,io.dropwizard.metrics,org.apache.cassandra,com.github.jnr,org.ow2.asm,org.jooq,javax.xml.bind,org.mariadb.jdbc,com.zaxxer,org.apache.activemq,org.apache.geronimo.specs,org.fusesource.hawtbuf,org.apache.kafka,com.github.luben,org.lz4,org.xerial.snappy,com.rabbitmq,jakarta.annotation,org.apache.thrift,org.apache.logging.log4j
</excludeGroupIds>
<excludes>
<!-- Actuator -->
Expand Down Expand Up @@ -656,11 +656,14 @@
<!-- Unnecessary netty deps -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
<artifactId>netty-codec-haproxy</artifactId>
</dependency>

<!-- removes boringssl from jar as all archs end up too big
we add this back in docker -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-haproxy</artifactId>
<artifactId>netty-tcnative-boringssl-static</artifactId>
</dependency>

<!-- Unnecessary micrometer deps -->
Expand Down

0 comments on commit 09c523d

Please sign in to comment.