-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved image for Docker Hub #1692
Conversation
@ankoh thank you so much for contributing, this is awesome! In addition to my other comments, generally speaking I don't think there's a need to maintain separate images for DockerHub and development. Let's just keep one image and pull everything out of |
--ingroup pipeline \ | ||
pipeline | ||
|
||
COPY docker-entrypoint.sh /usr/local/bin/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be a docker-entrypoint.sh
in this directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! COPY docker-entrypoint.sh references pkg/docker/hub/docker-entrypoint.sh.
the path is relative to the Dockerfile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah i see oops. It's gitignored somewhere. Sry I haven't seen that. I'll push in a sec.
@@ -0,0 +1 @@ | |||
select version(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see hello_world.sql
being used anywhere. I'm assuming it's there for convenience to manually run against a running container, but if it's not referenced anywhere let's leave it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pkg/docker/hub/tests/custom_init.yml mounts pkg/docker/hub/tests/init to /docker-entrypoint-init.d
the entrypoint runs all scripts in this folder, so if you run the custom_init.yml with docker-compose, you will see the version query in the docker logs.
@derekjn Sorry, that was my fault. I haven't realised that the most important file was gitignored. :-) custom_init.yml should yield something like this: |
@ankoh: Can you also keep |
@usmanm Sure, but then I'd propose to do it via arguments in the Dockerfile That might in fact be an interesting addition. That way you could keep a 200 MB (or 30MB in case of alpine) base image but still A) offer an easy way to build specific images on your own and B) maintain specific docker tags (e.g. pipelinedb/pipelinedb:0.9.5-kafka or pipelinedb/pipelinedb:0.9.5-extras). A kafka build could then look like: What do you think? I've already built an alpine image with all the dependencies that just fails at this single backtrace symbol. I could open a separate issue if you are interested in looking at that. |
I like the build args idea more. If you could share the Dockerfile with the base image of Alpine Linux, I'll figure out how to patch it/install |
@ankoh any progress on this? It would be great if we could get this into the next release. We're happy to help with the finishing touches if you'd like, just let us know! |
@derekjn I'm sorry I switched back to Postgres in my project and lost focus on this PR. I'll look at it later or tomorrow. |
@derekjn @usmanm I will do something like this: The (verbose) build command would look like: |
That sounds good! |
@derekjn @usmanm Here is a first draft for the Dockerfile with build arguments. The fuzzystrmatch module failed to install because it expected a different method signature for 'levenshtein_with_costs'. So I assume you changed the calculation of the levenshtein distance? That requires some investigation. Image sizes: Commands: |
@ankoh Really appreciate somebody puts more attention towards making an easy to use docker container for PipelineDB! One question I have: Is there a particular reason you left out the kinesis extension? If not, it would be awesome to see it added here as well to make this complete. |
@mhafellner Sure, I only considered the previous install_extras script. Image size: Command: With all these options enabled the build time is horribly long, not to mention the network traffic.. EDIT: Compilation fails with the most recent version of the AWS SDK, so you might want to check that at some point :). |
@ankoh thank you so much, this is looking great! And @mhafellner thank you for your feedback and input as well. I'm going to spend some time getting a feel for using the new |
Also looking into the |
👍 For an alpine linux based image |
824ecb5
to
3cbeaf8
Compare
Should resolve #1578.
Image size: 237.1 MB
It behaves very similar to the official Postgres image:
https://hub.docker.com/_/postgres/
https://github.com/docker-library/postgres/tree/e4942cb0f79b61024963dc0ac196375b26fa60dd/9.6
I added an easier way to bind a custom pipelinedb.conf into the image.
You can test the image with the following commands:
docker-compose -f pkg/docker/hub/tests/.yml build
docker-compose -f pkg/docker/hub/tests/.yml up
docker-compose -f pkg/docker/hub/tests/.yml rm -vf
E.g.:
docker-compose -f pkg/docker/hub/tests/custom_init.yml build
docker-compose -f pkg/docker/hub/tests/custom_init.yml up
docker-compose -f pkg/docker/hub/tests/custom_init.yml rm -vf
Please note that you need a newer version of docker-compose (for version 2 syntax).
I'd love to see an alpine linux based image in the future as they are much smaller.
(Postgres: 264MB [official] vs 31MB [alpine based])
As noted in #1578 one needs to patch a tiny glibc dependency. (Alpine ships with musl)