jbergstroem / mariadb-alpine

A tiny and fast MariaDB container
MIT License
72 stars 19 forks source link

Keep `mysqldump` #229

Closed Luc45 closed 1 year ago

Luc45 commented 1 year ago

This PR keeps mysqldump binary in the image. I'm curious to see how many kbs it adds to the image.

Luc45 commented 1 year ago

Hmm, it seems this would add 3.6 mb to the image :thinking:

docker run --rm temp-mariadb sh -c "du -h /usr/bin/mariadb-dump"                                                                                                 
3.6M    /usr/bin/mariadb-dump
Luc45 commented 1 year ago

Feel free to close this PR. 3.6 mb on a 15mb image is too much.

Luc45 commented 1 year ago

As a last attempt, I've edited the PR to add a build flag that adds mariadb-dump conditionally, eg:

docker build -t mariadb-alpine --build-arg BUILD_SLIM=true .

Would it make sense to release a "slim" version, that has a bit more stuff? For now, only mysqldump, but maybe some other nice-to-haves for specific cases.

jbergstroem commented 1 year ago

Would it make sense to release a "slim" version, that has a bit more stuff? For now, only mysqldump, but maybe some other nice-to-haves for specific cases.

(Not against it, but this also implies automating a build process that publishes all permutations)

To me, this container covers more or less everything from a server standpoint, especially for a local development setup. I wonder if having a similar setup for client tools makes sense?

There is something off with the mysql/mariadb build process I'm yet to debug. If you check a lot of the binaries created by the build system they are more or less the same size due to statically linking certain things. If I'm able to figure this out, a lot of the clients (cli, restore, dump, upgrade, ..) would probably shrink in size.

Luc45 commented 1 year ago

Indeed.

For my personal use case, I've worked around this by having a mariadb-dump binary on the host that I add to the alpine image as a volume.

I think a "slim" version of the image can be put on hold until there's more demand to it, what do you think?

If anyone stumbles into this PR, the most appropriate place to discuss it seems to be: https://github.com/jbergstroem/mariadb-alpine/discussions/230

jbergstroem commented 1 year ago

It makes sense, but yeah same topic as for https://github.com/jbergstroem/mariadb-alpine/issues/212 where I need mysqladmin and not an alternative

Just wanted to chip in here. I still am not sure why you need mysqladmin since all it does is connect and does select 1; which I already accomplish in the PR! If its about not changing any existing scripts on your side I guess it makes sense? As you can see, sacrifices in convenience are made to achieve the smallest possible container.

williamdes commented 1 year ago

It makes sense, but yeah same topic as for #212 where I need mysqladmin and not an alternative

Just wanted to chip in here. I still am not sure why you need mysqladmin since all it does is connect and does select 1; which I already accomplish in the PR! If its about not changing any existing scripts on your side I guess it makes sense? As you can see, sacrifices in convenience are made to achieve the smallest possible container.

I think what you are trying is very nice and should be in a -slim variant. But users could expect to have the same tools at a default mariabdb package/image and not something else

jbergstroem commented 1 year ago

But users could expect to have the same tools at a default mariabdb package/image and not something else

Perhaps the project is not explaining its purpose clearly enough? Do you have suggestions to how we can improve it?

williamdes commented 1 year ago

But users could expect to have the same tools at a default mariabdb package/image and not something else

Perhaps the project is not explaining its purpose clearly enough? Do you have suggestions to how we can improve it?

I think you are right, maybe my expectations where the wrong ones It's been years since my initial use of your project Maybe at the time I just wanted to have alpine containers running Not really sure, but the README is clear and makes sense

So maybe we can conclude that having a -tools variant would help

jbergstroem commented 1 year ago

So maybe we can conclude that having a -tools variant would help

Makes sense to me! I'm expanding the list of utils here: https://github.com/jbergstroem/mariadb-alpine/discussions/230#discussioncomment-5553714 - lmk if I'm missing something.

jbergstroem commented 1 year ago

Going to close this PR since I think we got a lot of useful info out of the discussion, but we won't be landing it in its current shape.

Sorry for the quiet, I will pick up a bit of slack in this area shortly.