openzipkin-attic / docker-zipkin

Docker images for OpenZipkin
Apache License 2.0
688 stars 329 forks source link

Changes base image to Alpine Linux with Zulu JRE 8 #46

Closed codefromthecrypt closed 9 years ago

codefromthecrypt commented 9 years ago

This change reduces the size of zipkin-base from 466.2 MB to 94.2 MB. This is achieved by switching from debian:sid to a minimal base image built on Alpine Linux; a Java Docker image doesn't get much smaller than this. Here's what changes.

Pulled up docker-compose up with these images built locally, ran zipkin-tracegen against them, and saw traces on the web interface.

# from docker-zipkin
$ docker build -t quay.io/openzipkin/zipkin-base:base-1.5.1 base
$ for I in cassandra collector query web
$   do docker build -t quay.io/openzipkin/zipkin-$I:1.5.1 $I
$ done
$ docker-compose up
# from zipkin
$ bin/tracegen 192.168.99.100
$ open http://192.168.99.100:8080/

Sizes before

$ docker images
REPOSITORY                            TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
quay.io/openzipkin/zipkin-web         1.5.1               febb7c1c8e09        7 hours ago         515.6 MB
quay.io/openzipkin/zipkin-cassandra   1.5.1               ca376e0a1eb6        7 hours ago         618.2 MB
quay.io/openzipkin/zipkin-query       1.5.1               e4b5209e85dd        7 hours ago         525 MB
quay.io/openzipkin/zipkin-collector   1.5.1               ac8bbc05c2e4        7 hours ago         533.6 MB
$ docker images
REPOSITORY                            TAG                 IMAGE ID            CREATED              VIRTUAL SIZE
quay.io/openzipkin/zipkin-web         1.5.1               05b4d0d6b886        49 seconds ago       143.5 MB
quay.io/openzipkin/zipkin-query       1.5.1               cedcdb8d1fba        About a minute ago   153 MB
quay.io/openzipkin/zipkin-collector   1.5.1               a55c2f3febde        About a minute ago   161.6 MB
quay.io/openzipkin/zipkin-cassandra   1.5.1               2fc3b7993288        About a minute ago   179.9 MB
quay.io/openzipkin/zipkin-base        base-1.5.1          c1174dc1512b        2 minutes ago        94.17 MB
delitescere/java                      8                   8effc79cfdc8        19 minutes ago       90.43 MB
codefromthecrypt commented 9 years ago

This work was almost all @abesto. The last mile was far easier with advice from @michaelsembwever

abesto commented 9 years ago

This is so exciting :)

Couple of nits inline. The only big one: we need to check in the compiled .class file to make this work on quay.io

Also, could you split up your work and mine into two commits? Just to make it clear who committed what sinswork.

codefromthecrypt commented 9 years ago

hehe the compiled file is checked in :) agree we need that as the whole point is to have this work with JRE. Addressing notes now.

codefromthecrypt commented 9 years ago

great point about comments.. done

abesto commented 9 years ago

Ah, sorry, guess I missed the tiny line for the binary file in the diff view.

abesto commented 9 years ago

:sparkles: Looks good! :shipit:

codefromthecrypt commented 9 years ago

ps to those wanting to get rid of the UnsatisfiedLinkError in the log. here's the cassandra upgrade https://github.com/openzipkin/docker-zipkin/pull/48

codefromthecrypt commented 9 years ago

Also.. This allows docker-compose to work on EC2's default of a t1.micro! IOTW zipkin for 1c/hr cc @spencergibb

$ docker-machine -D create \
   --driver amazonec2 \
   --amazonec2-access-key $AWS_ACCESS_KEY_ID \
   --amazonec2-secret-key $AWS_SECRET_ACCESS_KEY \
   --amazonec2-vpc-id $AWS_VPC_ID \
   --amazonec2-region us-west-2 \
   --amazonec2-zone b \
   test-instance1
# update security group to open port 9410,9411,8080
$ eval "$(docker-machine env test-instance1)"
$ cd docker-zipkin
$ docker-machine up -d
spencergibb commented 9 years ago

:+1:

spencergibb commented 9 years ago

Interestingly, I tried the java docker image with a spring-cloud/boot app and had to use delitescere/jdk:8 for some reason. /cc @dsyer @mstine