-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Is there a plan to make an alpine build of mysql? #179
Comments
Yeah, currently MySQL doesn't build on Alpine, unfortunately. |
+1 |
Now that postgres (from your comment above) and many other containers (node, etc) have official alpine variants, is it time to revisit this? |
I think improvements in the alpine c library now allows MySQL to build. Official support from Oracle isn't there, but we may be able to take another look at it. |
Is PR welcomed for alpine build, I was using recently alpine built mysql on our staging servers and it runs so far without problems. |
So I've found that we are using mariadb on staging and mysql doesn't compile currently with |
The last comment in MySQL ticket #80322 says that compilation on alpine is fixed for MySQL 8.0.2. I wonder if they'd be open to a backport to 5.6/5.7? Or if not, then perhaps a good first step would be adding an alpine config for just the MySQL 8.x image? |
Yeah, I've noticed that ticket, will try to compile mysql under alpine in coming week, if it succeeds, I'll be happy to give PR with alpine image as soon as stable MySQL 8.x is released. Don't know if there are any plans to backport those fixes (changes) to 5.6 and 5.7. |
Note that the ticket lists it as fixed in 8.0.2, which is not yet released. I'm working on a template system for the images (so we can offer OracleLinux-based ones without breaking every image out there that extends the Debian-based images). Once that's in I think adding alpine images is a good idea. |
It would be the top if #255 is also solved in this new alpine based image. |
One other issue is that even if the build is fixed, unless MySQL gets official Alpine support we won't build and publish packages for it. |
From the referenced MySQL ticket:
I guess there's green light for an Alpine version. |
Is there any PR going on for this issue? |
@AyushyaChitransh From looking at https://github.com/docker-library/mysql/pulls I don't see any pending one. |
So I guess there are currently plans to develop it and it is yet to be started. |
I use leafney/docker-alpine-mysql image, it installs mysql from alpine packages |
I guess we still need to wait for the MySQL 8 release, as it is the first release to officially support alpine linux. |
Yeah, this isn't just blocked on the ability to build, but also Oracle
officially supporting it. Just being able to build it is not sufficient.
|
Okay, it's been a while! Any progress on this one? |
I think #179 (comment) is still accurate (but perhaps @ltangvald can comment further as to whether Oracle has decided to officially support MySQL on Alpine):
|
Sorry, but that installs MariaDB, not MySQL. |
MySQL 8.0 does now build with alpine, and we've done some work on creating Docker images, but there are a couple of issues:
|
@ltangvald I'd be very curious how you managed to get down to ~150MB -- I've done some work on this and only got as low as ~196MB, and that's manually pruning a number of things, especially extra binaries (loosely based on what the PostgreSQL does indeed build from source on Alpine, so that's not a big deal -- on my 12-core system I'm able to build the Alpine image I've been working on in ~9 minutes, and we've got a really beefy arm64v8 system I've been testing on as well that builds in a similar time frame, which is perfectly reasonable IMO (it'll be slower on our AWS amd64 workers, but such is life). Honestly, I think even ~196MB for an Alpine image is still pretty interesting compared to ~343MB for the Debian alternative. |
We built alpine packages very similar to the minimisation used for the mysql-community-server-minimal rpm (that in turn is used for the mysql/mysql-server image). The differences there are that the oraclelinux:7-slim one is 246MB, and the alpine one around 150MB (talking 8.0 now). The savings in size come mostly from the removal of binaries. Also, the run script currently depends on bash and mysql still has a runtime dependency on gcc (this would be the differences to a "pure" alpine binary). Note that the pg binary itself is 8MB whereas mysql is 40MB, PG is written in C if I'm not mistaken. Like @ltangvald mentioned the alpine thing comes at the cost of having to have Oracle support for it in place, currently difficult to prioritise on our end (although we do have a working prototype, the infamous ~150MB alpine image). Maybe it's enough in terms of size if we try to get the official and supported Oracle one based on Oracle linux in? This would make use have a 246MB image for free (and it is supported and we probably can maintain that in the future, especially if it is identical or easily generated from the mysql/mysql-server one). We'll discuss that a bit more internally and hopefully we'll be able to make more concrete suggestions soon. Our main interests here are to keep the duplication of code (run scripts mainly, but also the Dockerfiles) to a minimum in order to be able to maintain and support and help. @tianon if you have a pr or branch with your alpine sources I can comment on what is the difference with my prototype. Maybe if you take a look at https://github.com/mysql/mysql-server/blob/8.0/packaging/rpm-docker/mysql.spec.in that can also help. |
This comment has been minimized.
This comment has been minimized.
For the upstream image I've experimented a little with stripping away any non-essential parts of the image, but doing a multi-stage build that only copies over what the MySQL binaries/entrypoint link to. This gives an OracleLinux-based image of about 100MB, vs the alpine image's 150MB (though you lose most OS functionality from it). |
As far as I know, Alpine images were introduced because they were significantly smaller, if that is not the case then I don't see a reason to have them. docker-library/python#211 FYI, multi-stage builds are not supported by offical-images: docker-library/official-images#3383 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Apologies for reviving this stale discussion, but I thought to point out that other than size, Alpine focuses quite a bit on security too. Notably, their official about page states that userland binaries are compiled with stack-smashing protection. |
(To this end, I'm going to close this issue -- we will revisit if/when Oracle officially supports Alpine Linux. 👍) |
Haven't tried, but according to MySQL changelog there's a Bugfix...
|
I'm guessing that's not intended to imply explicit support for musl libc, but rather that applying a best-effort bugfix for musl (likely with a low maintenance burden) doesn't hurt them and helps downstreams like Alpine Linux continue to package and distribute their project. |
No description provided.
The text was updated successfully, but these errors were encountered: