spotify / docker-bigtable

A docker container with an in memory implementation of Google Cloud Bigtable
Apache License 2.0
72 stars 10 forks source link

Use a Alpine and multi stage builds to lower image footprint #4

Closed julienatshopify closed 6 years ago

julienatshopify commented 6 years ago

Problem

The image is currently quite large (~ 350MB) and so can be taxing for build systems.

Solution

Use a combination of Alpine and multistage build in order to reduce the resulting image. The multistage allows to not worry about build time dependencies and just copy over the executable we are interested in.

Result

An image with the same features as before, but around 17 MB.

@rgruener

pseudomuto commented 6 years ago

👍 - The multistage build is a nice touch

rgruener commented 6 years ago

:+1: Thanks for this change (as well as the other change you proposed). I actually no longer have any merge rights for this repo. Perhaps @gandalfhz can help with that?

Side not though is that once google released the bigtable emulator as part of their gcloud tools and made a docker image with it this repo is not really so useful since you can get the same functionality by running docker run -p 127.0.0.1:8086:8086 --rm -ti google/cloud-sdk gcloud beta emulators bigtable start --host-port=0.0.0.0:8086 as outlined in https://github.com/spotify/docker-bigtable/issues/2 Just curious if you were aware of that or if there was something specific in here you needed?

julienatshopify commented 6 years ago

@rgruener Thanks for looking at it! I was actually aware of google/cloud-sdk, but it is even larger and slower to download, so the issue is even worse. We ended up publishing our own that is solving all the usability issues we had: https://github.com/Shopify/bigtable-emulator.

rgruener commented 6 years ago

Cool. I guess this has a smaller image footprint and it gives flexibility to do things like include the column families to create on startup.

I created this mainly because there wasn't a solution available and maintained by Google at the time for doing this in docker. Perhaps the bigtable team could do something that is slightly easier to download (though that wasn't a huge problem for me at spotify). @garye @mbrukman

julienatshopify commented 6 years ago

It seems there is no interest.