Skip to content

Building locally for Apple M1 #824

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

Closed
bozzltron opened this issue Feb 17, 2022 · 6 comments
Closed

Building locally for Apple M1 #824

bozzltron opened this issue Feb 17, 2022 · 6 comments

Comments

@bozzltron
Copy link

Hello.
I'd like to build this image locally for Apple's new chip architecture. I tried cd'ing into /8.0 and running docker build . -f Dockefile.debian.

I get a failure on step 9 of 12.

=> ERROR [ 9/12] RUN { echo mysql-community-server mysql-community-server/data-dir select ''; echo mysql-community-server mysql-community-server/root-pass password ''; echo mysql-community-server mysql-commu 4.5s

@tianon
Copy link
Member

tianon commented Feb 17, 2022

Unfortunately, the Debian-based images do not support arm64 so you'd have to use emulation to build/use them on M1 (see #318). However, we just merged #680, so you should give it another try with Dockerfile.oracle (which does support arm64), or wait for docker-library/official-images#11888 to merge/build/push. 👍

@tianon tianon closed this as completed Feb 17, 2022
@bozzltron
Copy link
Author

Thank you.

@Anticom
Copy link

Anticom commented Apr 7, 2022

@tianon This only applies to 8.0 tho, right? I am able to build that one, however for 5.7 I'm getting:

# [...]
 => ERROR [ 7/10] RUN set -eux;  yum install -y "mysql-community-server-minimal-5.7.37-1.el7";  yum clean all;  grep -F 'socket=/var/lib/mysql/mysql.sock' /etc/my.cnf;  sed -i 's!^socket=.*!socket=/var/run/mysqld/mysqld.sock!' /etc/my.cnf  1.2s
------
 > [ 7/10] RUN set -eux;        yum install -y "mysql-community-server-minimal-5.7.37-1.el7";   yum clean all;  grep -F 'socket=/var/lib/mysql/mysql.sock' /etc/my.cnf;         sed -i 's!^socket=.*!socket=/var/run/mysqld/mysqld.sock!' /etc/my.cnf; 	grep -F 'socket=/var/run/mysqld/mysqld.sock' /etc/my.cnf; 	{ echo '[client]'; echo 'socket=/var/run/mysqld/mysqld.sock'; } >> /etc/my.cnf; 		! grep -F '!includedir' /etc/my.cnf; 	{ echo; echo '!includedir /etc/mysql/conf.d/'; } >> /etc/my.cnf; 	mkdir -p /etc/mysql/conf.d; 		mysqld --version; 	mysql --version:
#11 0.164 + yum install -y mysql-community-server-minimal-5.7.37-1.el7
#11 0.258 Loaded plugins: ovl
#11 1.222 https://repo.mysql.com/yum/mysql-5.7-community/docker/el/7/aarch64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
#11 1.222 Trying other mirror.
#11 1.222
#11 1.222
#11 1.222  One of the configured repositories failed (MySQL 5.7 Server Minimal),
#11 1.222  and yum doesn't have enough cached data to continue. At this point the only
#11 1.222  safe thing yum can do is fail. There are a few ways to work "fix" this:
#11 1.222
#11 1.222      1. Contact the upstream for the repository and get them to fix the problem.
#11 1.222
#11 1.222      2. Reconfigure the baseurl/etc. for the repository, to point to a working
#11 1.222         upstream. This is most often useful if you are using a newer
#11 1.222         distribution release than is supported by the repository (and the
#11 1.222         packages for the previous distribution release still work).
#11 1.222
#11 1.222      3. Run the command with the repository temporarily disabled
#11 1.222             yum --disablerepo=mysql5.7-server-minimal ...
#11 1.222
#11 1.222      4. Disable the repository permanently, so yum won't use it by default. Yum
#11 1.222         will then just ignore the repository until you permanently enable it
#11 1.222         again or use --enablerepo for temporary usage:
#11 1.222
#11 1.222             yum-config-manager --disable mysql5.7-server-minimal
#11 1.222         or
#11 1.222             subscription-manager repos --disable=mysql5.7-server-minimal
#11 1.222
#11 1.222      5. Configure the failing repository to be skipped, if it is unavailable.
#11 1.222         Note that yum will try to contact the repo. when it runs most commands,
#11 1.222         so will have to try and fail each time (and thus. yum will be be much
#11 1.222         slower). If it is a very temporary problem though, this is often a nice
#11 1.222         compromise:
#11 1.222
#11 1.222             yum-config-manager --save --setopt=mysql5.7-server-minimal.skip_if_unavailable=true
#11 1.222
#11 1.222 failure: repodata/repomd.xml from mysql5.7-server-minimal: [Errno 256] No more mirrors to try.
#11 1.222 https://repo.mysql.com/yum/mysql-5.7-community/docker/el/7/aarch64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
------
executor failed running [/bin/sh -c set -eux; 	yum install -y "mysql-community-server-minimal-$MYSQL_VERSION"; 	yum clean all; 	grep -F 'socket=/var/lib/mysql/mysql.sock' /etc/my.cnf; 	sed -i 's!^socket=.*!socket=/var/run/mysqld/mysqld.sock!' /etc/my.cnf; 	grep -F 'socket=/var/run/mysqld/mysqld.sock' /etc/my.cnf; 	{ echo '[client]'; echo 'socket=/var/run/mysqld/mysqld.sock'; } >> /etc/my.cnf; 		! grep -F '!includedir' /etc/my.cnf; 	{ echo; echo '!includedir /etc/mysql/conf.d/'; } >> /etc/my.cnf; 	mkdir -p /etc/mysql/conf.d; 		mysqld --version; 	mysql --version]: exit code: 1

@tianon
Copy link
Member

tianon commented Apr 7, 2022

Yes, that's correct -- unfortunately the upstream arm64v8 builds are only available on MySQL 8.

@Sylk
Copy link

Sylk commented Apr 11, 2022

With this edition, does that mean that I can build this on both m1 & intel macs?
And does this mean I no longer need to use this to build my docker containers to support that case?

https://github.com/jamielsharief/docker-mysql

@tianon
Copy link
Member

tianon commented Apr 11, 2022

The published builds of mysql:8.0-oracle will support both M1 and Intel Macs, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants