-
Notifications
You must be signed in to change notification settings - Fork 440
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
Add Alpine variant #343
Add Alpine variant #343
Conversation
#53 is still very relevant -- what's changed since that was closed? 😕 (See also https://jira.mariadb.org/browse/MDEV-18462, where upstream seems still committed to not officially supporting Alpine Linux.) |
Various patches have been accepted upstream including some specifically for Alpine Linux. It builds now without any additional patches. |
Specifically, from #53 (comment):
|
I suggest the MDEV is watched and once it's done then a new PR would make sense. Letting this PR open whereas the related MDEV is not done, doesn't help. Is that acceptable? |
Isn't this PR kind of fixing https://jira.mariadb.org/browse/MDEV-18462? |
Its kind of forcing it into production without a CI testing process behind it. As far as I can tell, the main driver is size. Linux server does an alpine distribution of: docker.io/linuxserver/mariadb alpine a2ca1767a30f 6 days ago 294 MB latest being a bionic base, so these are still smaller than the ones from here: docker.io/library/mariadb 10.5 992bce5ed710 6 days ago 407 MB And from alpine itself, its a rather small component of this: docker.io/library/alpine latest 6dbb9cc54074 2 weeks ago 5.88 MB Compared to the ubuntu sizes: docker.io/library/ubuntu focal 7e0aa2d69a15 7 days ago 75.1 MB If ubi was used as a base ( https://github.com/grooverdan/ubi-mariadb ) I get: localhost/ubi-mariadb 10.5.9 e63d31d3b847 24 seconds ago 579 MB Looking the packages installed here there are a large number of unneeded large pages, glib2, perl, python3, systemd, gnupg, file-libs so there's a significant amount of room to improve. As a comparison point, MariaDB does do a (mostly) statically linked tar.gz files https://downloads.mariadb.org/mariadb/10.5.9/#os_group=linux_generic of 343.6 MB which in uncompressed from can go from 1.2G to 60M with brutal pruning of client programs, test suites, stripping of executables. On size alone, taking a tar and adding busybox as a base image to handle the entrypoint might be the smallest possible: docker.io/library/busybox 1.33-musl 1f8bca985304 3 weeks ago 1.65 MB So on size, Alpine + a staticly linked (all but musl-libc) tar.gz based image will probably be the second smallest reasonably achievable. A ubi-minimal based one would be about third (with added benefits of using existing tar.gz, Red Hat support etc, unclear if/how it would be on dockerhub however - docker-library/official-images#9445). Has anyone done performance tests of musl mariadb vs glibc mariadb? Are there any other driving requirements that has led to an alpine approach? |
@J0WI any other requirements that lead this Alpine PR? Are the alternatives suggested acceptable? There's vague hint in #53 that consistency of base images enables adding of apk usage on top of it. I'm not totally against Alpine, but if there's a way to meet its requirements in a supported (CI + generally better tested) way and satisfy other users as well with less effort I'm definitely going to favour that approach. |
Thanks @J0WI. You've probably noticed me pushing for ppc64le support where upstream support existed back in #154. Adding architectures ends up in the same case as adding muslc, its hardly sane to do it without a CI process behind it, or some hardware available for testing if things go wrong. s390x support has been requested in MDEV-23155 and with IBM providing access its something that could be done. arm32v7 might be something to consider but at the moment without hardware debugging them is hard - MDEV-24756. i386 accidentally dropped off support in the way debian got packages, and no-one noticed or complained about the dropping of support. arm32v6 is probably too old. mips64le could be something to aim to support, its range of optional extensions is a bit daunting from a packaging/coding point of view. MariaDB/server#1805 has some options that might enable its support. |
I think the older arm32 platforms are mostly relevant for Pi users. Postgres supports all of them. MariaDB packages are available in the distro repos but not on Docker. |
Noted.
Yes it seems to be based on the Debian disto packaging but more importantly - https://www.postgresql.org/docs/current/supported-platforms.html list them as supported which matches their build farm.
Yes, and arch dependent bugs linger https://bugs.debian.org/cgi-bin/pkgreport.cgi?src=mariadb-10.5 . I'd rather users ask for support in architecture/platform X than to try to over-deliver beyond a reasonably tested codebase. Unlike Debian we don't have an upstream to offload the problem to. |
I wouldn't suggest losing much sleep over |
Please notice some Alpine caveats In my experiences:
For small images is better to use the Distroless. It includes glibc ( |
Thanks for sharing.
Glad --skip-name-resolve is default however.
The common libc functions I've seen in MariaDB performance profiles are memcpy and memcmp who's simple muslc implementation (memcmp) doesn't correspond the the more optimized version in libc (however the compiler seem to do a fairly verbose transform - I looked with
|
I would also notice that functions like |
recent example on why we're not jumping to support musl/armv7 without a backing CI in place. I did search JIRA for armv7 based issues, and with the exception of distro maintainers reporting failing unit tests (rather than user reported issues), there did appear to be a small number of users. |
@J0WI apart from forking your own entrypoint this looked pretty decent from a container point of view. Bases on reliability backed up by recent bugs like MDEV-24756 shows how badly things can go with no easy resolution because of alpine/musl/arm32v7. So I'm closing this. I've added the FAQ to the README at the top level. Based on which requirement comes first I or someone else may open this back up later. |
No description provided.