Skip to content
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

Move away from Alpine as container base #49

Closed
jbergstroem opened this issue Sep 20, 2020 · 8 comments
Closed

Move away from Alpine as container base #49

jbergstroem opened this issue Sep 20, 2020 · 8 comments
Assignees
Labels
type: feature Request to add new functionality

Comments

@jbergstroem
Copy link
Owner

Seeing how Alpine and MariaDB are having longstanding issues that doesn't seem to find a resolution anytime soon, using another base while achieving a similarly minimal size would be a good next step.

I am currently building MariaDB from scratch in fedora:rawhide and will do a PR shortly that hopefully passes tests.

@jbergstroem jbergstroem added the type: feature Request to add new functionality label Sep 20, 2020
@jbergstroem jbergstroem self-assigned this Sep 20, 2020
@jbergstroem jbergstroem changed the title Move away from Alpine Move away from Alpine as container base Sep 20, 2020
@jbergstroem
Copy link
Owner Author

jbergstroem commented Sep 27, 2020

A WIP container that passes tests locally is available here for testing. Any feedback much appreciated!
I will be running it on my zfs setup next to see if we are avoiding issues.

Check it out by pulling jbergstroem/mariadb-alpine:test-rawhide-glibc (yes, there will be a future naming issue 😄):

$ docker run -it -e SKIP_INNODB=1 jbergstroem/mariadb-alpine:test-rawhide-glibc
2020-09-27 14:28:07 0 [Note] /bin/mysqld (mysqld 10.4.14-MariaDB) starting as process 1 ...
2020-09-27 14:28:07 0 [Note] Plugin 'InnoDB' is disabled.
2020-09-27 14:28:07 0 [Note] Plugin 'unix_socket' is disabled.
2020-09-27 14:28:08 0 [Note] Server socket created on IP: '::'.
2020-09-27 14:28:08 0 [Note] Reading of all Master_info entries succeeded
2020-09-27 14:28:08 0 [Note] Added new Master_info '' to hash table
2020-09-27 14:28:08 0 [Note] /bin/mysqld: ready for connections.
Version: '10.4.14-MariaDB'  socket: '/run/mysqld/mysqld.sock'  port: 3306  MariaDB Server

Few tidbits:

  • It is ~12% smaller than the current image uncompressed (~9% compressed)
  • The changes to the current files are minimal (readme will gain updates later):
    $ git diff --staged --numstat
    172     0       Docker-rawhide
    1       0       my.cnf
    5       5       sh/run.sh
  • I am planning on making this a template and therefore build permutations (So far, the idea is to support 10.2.x, 10.3.x, 10.4.x and 10.5.x series)
  • Haven't been able to put together a reliable benchmark (yet) but it feels equally snappy to the previous container.
  • The goal is to have zero user interface changes (read: the way you interact with it) sans perhaps a new name since it is no longer based on alpine

@sausix
Copy link

sausix commented Jan 16, 2021

@jbergstroem
... Alpine and MariaDB are having longstanding issues ...

Any link to details?
Thanks.

@jbergstroem
Copy link
Owner Author

jbergstroem commented Jan 17, 2021

Any link to details?

@sausix collected info in this issue: #1

@sausix
Copy link

sausix commented Jan 18, 2021

Thanks.
It's mostly a (fixed) ZFS issue.

Databases on CoW (copy on write) systems should be handled with care generally.
You should mention it in the README.md.

I'm using btrfs on my host and prepared an empty directory for mariadb's data files with chattr +C to disable CoW for all new files and directories within it. Works for volumes too. It's important that the files are not created yet.

@jbergstroem
Copy link
Owner Author

Databases on CoW (copy on write) systems should be handled with care generally.
You should mention it in the README.md.

Want to open a PR? 😄

I'm using btrfs on my host and prepared an empty directory for mariadb's data files with chattr +C to disable CoW for all new files and directories within it. Works for volumes too. It's important that the files are not created yet.

Since we're talking in this issue; would you have issues with switching to a glibc-based host? Seeing how the bug is fixed upstream now (it lacked attention for a long time which is why I opened this) its less important from a bug perspective, but the amount of work I put into shaping the new container actually makes it both more optimized, more rigid to version updates (and what files to bundle) and likely more performant due to glibc.

@sausix
Copy link

sausix commented Jan 18, 2021

Want to open a PR?

Maybe :-D
But currently totally busy with other Docker issues (poor IPv6 support) :-D

would you have issues with switching to a glibc-based host?
No. I knew about Alpine but wasn't aware of it's benefits and small footprint.
musl is nice but not a requirement for me. If glibc is more performant, it's a good point.

I just hope you don't end on maintaining a full grown base image like ubuntu.

PR for README will come soon.

@jbergstroem
Copy link
Owner Author

jbergstroem commented Jan 18, 2021

I just hope you don't end on maintaining a full grown base image like ubuntu.

The goal of this repository/project is to create the smallest-yet-fully-functional oci image possible.

@jbergstroem
Copy link
Owner Author

Going to close this since the bug is fixed in newer versions of MariaDB and we still want to lean on Alpine to achieve multi-arch support (arm, ..).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Request to add new functionality
Projects
None yet
Development

No branches or pull requests

2 participants