docker-library / mysql

Docker Official Image packaging for MySQL Community Server
https://dev.mysql.com/
GNU General Public License v2.0
2.47k stars 2.2k forks source link

support arm64 architecture #318

Closed longquan7 closed 2 years ago

longquan7 commented 7 years ago

I want to build this image on arm64 architecture but I don't find arm64 package in this file http://repo.mysql.com/apt/debian/dists/jessie/InRelease , So I want to know the image whether or not support arm64 architecture.

yosifkit commented 6 years ago

This would need support from MySQL upstream to release packages for other architectures in their apt repo. (to me, this seems unlikely since they don't commercially support much more then i386 and amd64: https://www.mysql.com/support/supportedplatforms/database.html)

cc @ltangvald would mysql be willing to build their apt packages on more architectures? (like arm64v8, arm32v7, ppc64le, and s390x)

gnumoksha commented 6 years ago

@yosifkit debian has mysql server package for arm architecture. I am using it on a few Raspberry Pi.

tianon commented 6 years ago

Debian's versions won't be up to date with upstream's, which is why these images consume packages exclusively from upstream's repositories.

In the meantime, I'd recommend creating your own image which installs Debian's packages if this is something you need right away.

smallfryy commented 6 years ago

@longquan7 - did you find a solution? I'm also looking to build mySQL:5.7 image on arm64 architecture (Odroid XU3, per issue referenced above).

longquan7 commented 6 years ago

@samalba Nothing yet.This would need support from MySQL upstream to release packages.

geerlingguy commented 6 years ago

Just a note for anyone who needs a working image for testing purposes (though I'd recommend building your own for prod!) for Raspberry Pi at least—I've tested the following two and can confirm they work okay on my Pi 3 B and 3 B+ with Raspbian:

Note that they only support MySQL 5.5 at this time.

shawnguo2 commented 6 years ago

@ltangvald I'm particularly wondering about mysql's take on arm64 architecture support, considering there are a lot of push on arm64 enterprise from industry. Is there any plan already being discussed or just no, nothing on that? Thanks much.

ltangvald commented 6 years ago

We do have an experimental preview out https://blogs.oracle.com/wim/mysql-805-community-edition-preview-for-oracle-linux-7-for-arm64-preview (8.0.5 was never released, but was instead renamed to 8.0.11), but I don't really have any more concrete information than that :)

Debian stretch does not have MySQL. They just have a mysql-server package that actually points to MariaDB. Ubuntu has MySQL, but generally only a single version (5.7)

5.7 and 8.0 can also be built on raspberry pi, but I think the build needs to be tweaked since the device is short on memory.

shawnguo2 commented 6 years ago

@ltangvald Thanks much for your input. It's very helpful for us to understand the status of MySQL on arm64. As per comments from @yosifkit and @tianon, we should only get MySQL package from MySQL upstream repo. Before MySQL releases debian package for arm64, It seems the only way for getting arm64 support in official image is to add an OL (Oracle Linux) variant for MySQL docker image? Or is there any other way around?

ltangvald commented 6 years ago

The only other option would be to build the server from scratch, on arm64, and it's unlikely to be made a part of the official image.

Regarding an OL variant, we're hoping to add them to the official image soon (this is hanging on me, as I need to make a templating system so we don't double the maintenance work by adding more images).

We do already have the OL variant upstream (mysql/mysql-server instead of just mysql), but that doesn't have an arm64 version either.

shawnguo2 commented 6 years ago

@ltangvald Really appreciate your comments. Please let me know if the templating system is available for OL variant. I will be more than happy to help add arm64 architecture to it. Thanks!

shawnguo2 commented 6 years ago

@ltangvald While waiting for your OL variant templating work for official image, I'm wondering if adding arm64 support to mysql/mysql-server image makes any sense. I looked into its Dockerfile and found that it's based on OL slim image and uses minimal version of mysql-community-server and mysql-shell package, which are unavailable from arm64 repo [1]. Does that mean if we want to support arm64 in this image, we will need these two packages for arm64? Or can we switch the image over to use full version of mysql-community-server that is available on both x86_64 and arm64? Maybe this is a question for @bkandasa? Thanks!

[1] http://yum.oracle.com/repo/OracleLinux/OL7/latest/aarch64/index.html

ltangvald commented 6 years ago

The currently available MySQL package for arm64 was an experimental, one-off release. We wouldn't be able to add it to the mysql/mysql-server image until it's supported for the regular releases (in which case we'll most likely have access to the same minimal-server images).

lag-linaro commented 6 years ago

Out of interest, what are the likely timescales for having ARM64 support for the regular releases?

@ltangvald, is there anything we can do to expedite the process?

tianon commented 6 years ago

@ltangvald it appears that https://repo.mysql.com/yum/mysql-8.0-community/docker/aarch64/ is looking a bit more official now :smirk:

Any chance that's coming to the APT builds soon, and/or that arm64v8 support for mysql/mysql-server is on the horizon? :smile: :+1:

ltangvald commented 6 years ago

Hi,

For the former (arm support for apt platforms), I unfortunately don't know. For the latter, I'm actually working on it right now (I basically just need to figure out the multi-arch manifests and it will be published). Once the changes I proposed in pr #471 have been finalized (as I mention there it might be more sensible to split it up) I was going to make another one to add rpm-based images to the official repo, for 5.7 and 8.0.

ltangvald commented 6 years ago

We've published the upstream aarch64 image now. Since it's still somewhat experimental we used a separate tag: mysql/mysql-server:8.0-aarch64

lag-linaro commented 6 years ago

Do you have a link to the PR/URL please?

ltangvald commented 6 years ago

It's not properly added to our build pipeline yet, but the source for the arm image can be seen here: https://github.com/ltangvald/mysql-1/blob/mysql-server-arm/8.0-aarch64/Dockerfile

The only thing changed from https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile is the rpm url, plus a required workaround noted at https://dev.mysql.com/doc/refman/8.0/en/linux-installation-yum-repo.html#yum-install-platform-specifics (at line 21 and 24)

lag-linaro commented 6 years ago

It's been a while, so I thought I'd check in. I see that ARM64v8 is still not supported.

Have you guys moved forward in any way?

keithy commented 5 years ago

Not sure what the big deal is, there are plenty of builds of MySQL and MariaDB out there for arm64v8. I'm using yobasystems/alpine-mariadb

In the docker-compose file I substitute:

image: "xwiki:latest"

build: 10/mysql-tomcat

Moment of truth...

ltangvald commented 5 years ago

Essentially, once PR #471 is done I'll make another one to include ol7-based variants, which can then include upstream's arm64 image

lag-linaro commented 5 years ago

Sorry to keep bugging you about this every 2 months (:wink:), but are we any closer to solving this?

I see #471 gained quite a lot of traction, but it seems to have stagnated.

lag-linaro commented 5 years ago

So I tried to open a discussion on AArch64 releases on https://forums.mysql.com, but my post was unapproved without explanation which was frustrating. Especially seeing as it's the only official platform to request support without "contacting a sales representative".

@ltangvald do you know why the AArch64 package(s) has been released for YUM rather than APT. The x84_64 packages seem to have been released for the latter.

Also, could someone tell me what the difference between this and https://hub.docker.com/r/mysql/mysql-server is please? The latter already seems to have AArch64 support and is subsequently docker pullable.

ltangvald commented 5 years ago

AArch64 support is in its early stages for MySQL, but I don't know what the plans are for future releases with regards to platform support.

Essentially, mysql/mysql-server is the image that is made and owned by Oracle (there are also mysql/mysql-cluster and mysql/mysql-router images). It's made to have the same basic functionality, but is missing certain things like the gosu support. The big technical difference is that it uses oraclelinux:7-slim as the base image, so it can use the existing aarch64 packages published by Oracle. It also uses an rpm custom-made for docker, which is stripped down, while the official mysql image uses our regular apt packages (but for 8.0 those provide -core packages that are similarly stripped).

lag-linaro commented 5 years ago

@ltangvald thanks for your reply, I appreciate it.

So that's why the AArch64 package at https://repo.mysql.com/yum/mysql-8.0-community/docker/aarch64 uses YUM instead of APT, so it can be consumed with Oracle Linux which is RPM based?

Hopefully your Templatize and refactor 5.7+ entrypoint scripts PR can be merged soon and you can work on supporting the AArch64 releases via this project. It would be great to have docker pull mysql working on AArch64 platforms.

Do you mind me asking what the implementation details would look like? I assume, since they use a different package manager a new Dockerfile will be required?

ltangvald commented 5 years ago

Right. Dockerfile for ol7-based image would be pretty different, but they are also fairly simple to maintain Upstream uses https://github.com/mysql/mysql-docker/blob/mysql-server/8.0/Dockerfile, and we'd need to add the gosu setup, but the entrypoint script should be possible to use as it is from the existing template in #471

lag-linaro commented 5 years ago

Works for me. How exciting.

Do you know when this might become part of the Official Image?

acodercat commented 5 years ago

hope arm image

rhenwood-arm commented 5 years ago

Is there any news on the progress of this AArch64 image?

lag-linaro commented 5 years ago

Looks like the dependency is still not satisfied: https://github.com/docker-library/mysql/pull/471

everflux commented 5 years ago

I would like to see an arm image as well. For the mean time I will use the official mariadb arm image https://hub.docker.com/_/mariadb perhaps it is sufficient.

lag-linaro commented 5 years ago

Is #471 really still blocking this issue?

This ticket has been open a year now - it seems that people are fast moving to MariaDB.

Is there anything else we can do to unblock this?

lag-linaro commented 5 years ago

Looks like I missed the 2 year anniversary! :birthday:

Any news good folks?

lag-linaro commented 5 years ago

I'm guessing you know where this is going ...

Now that #471 has been merged, could we turn our attention to supporting aarch64 please?

ltangvald commented 5 years ago

Yeah. My idea for this is to add support for rpm-based images since repo.mysql.com offers rpms for aarch64. This would only be for 8.0, though.

lag-linaro commented 5 years ago

What would happen for subsequent releases?

ltangvald commented 5 years ago

You mean when e.g. there's a 9.0? arm support for 8.0 wouldn't be removed (it's just that 8.0 was the first version upstream added official arm support for).

arjunkamp commented 4 years ago

Hi,

Pinging on this issue. A few questions as well, hopefully not too elementary:

  1. Should we be expecting an 8.x ARM64 mysql official image, or is it delayed til 9.0?
  2. If I search on "mysql-server", I see that Oracle has ARM64 containers for mysql. These aren't labelled official, and not sure (outside of supported architectures) what the deltas would be between those containers and containers here.

Thanks in advance, Arjun

geerlingguy commented 4 years ago

It seems like the arm64 images are built now, for 8.0 only, for the mysql/mysql-server image at least: https://hub.docker.com/r/mysql/mysql-server/tags

Code-Hex commented 3 years ago

Hey, if you want to run MySQL 5.7, let's use this one https://hub.docker.com/r/codehex/ubuntu-mysql

tisba commented 3 years ago

It seems like the arm64 images are built now, for 8.0 only, for the mysql/mysql-server image at least: https://hub.docker.com/r/mysql/mysql-server/tags

It doesn't look like they are getting updated regularly. Latest 8.x are not available in arm64 :(

ltangvald commented 3 years ago

Which image are you missing? 8.0.22 should be available for arm.

rfay commented 3 years ago

library/mysql does not have arm64 images for mysql 8. See https://hub.docker.com/_/mysql?tab=tags&page=1&ordering=last_updated

library/mysql-server does have built arm64 images, but it's a completely different an unrelated build (Not debian). https://hub.docker.com/r/mysql/mysql-server/tags?page=1&ordering=last_updated

ltangvald commented 3 years ago

Right, because MySQL upstream does not support|publish arm packages on Debian, only oraclelinux (which is what mysql/mysql-server is based on).

hiroshi commented 3 years ago

FYI: If you just want to run a mysql image on docker Desktop for M1 mac, you can use amd64 image (with QUEM I think).

docker-compose.yml

services:
  mysql:
    image: mysql:5
    platform: linux/amd64
    ...

It works for me. (EDIT: I'm not sure about performance though...)

(or docker (pull|run) --platform=linux/amd64 maybe)

TheHuge commented 3 years ago

Official Docker's documentation mentions this and also proposes tu use mariadb ARM64 image as a workaround.

rfay commented 3 years ago

MariaDB is a fine workaround for some uses, but MySQL 5.7 and then extensively 8.0 have moved quite a ways from their roots. So for many uses, MariaDB is not a reasonable workaround.

hiroshi commented 3 years ago

@TheHuge Hi, just give you head up. Your link is broken, but thanks for the information 👍 Image from Gyazo

khalwat commented 3 years ago

Hoping for ARM support for Apple Silicon M1, etc. in the official Docker images, using mysql/mysql-server for now instead.

Thanks for all you do!