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

[Discussion] Change database to mariadb #54

Open
TheCadien opened this issue Feb 14, 2021 · 5 comments
Open

[Discussion] Change database to mariadb #54

TheCadien opened this issue Feb 14, 2021 · 5 comments

Comments

@TheCadien
Copy link
Member

TheCadien commented Feb 14, 2021

At this time the mysql image does not support ARM processors. Or in other words, it does not work on the new M1 from Apple .
I tested the set up on an M1 once with Maria DB.
With Maria DB it works and seems to run the same way as with mysql.

So what do you think about changing the setup from mysql to maria db for supporting the ARM stack with no disadvantage for other machines.

Proposed solution

db:
    image: mariadb:10.5.8
    command: --default-authentication-plugin=mysql_native_password
    ports:
      - ${PORT_MYSQL}:3306
    volumes:
      - ./data/mysql:/var/lib/mysql
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
@mario-fehr
Copy link

mario-fehr commented Feb 14, 2021

@TheCadien or switch to mysql/mysql-server that has ARM64 on the docker page which interestingly is a fork from the original docker-library/mysql sulu-docker uses.

EDIT:

Did not read the warning on the docker page.

Warning

The MySQL Docker images maintained by the MySQL team are built specifically for Linux platforms. Other platforms are not supported, and users using these MySQL Docker images on them are doing so at their own risk. See the discussion here for some known limitations for running these containers on non-Linux operating systems.

So Maria DB is a good option.

@niklasnatter
Copy link
Contributor

For reference, this is the issue regarding arm64 support for the official mysql image: docker-library/mysql#318

I do not have any experience with using mariadb. But I am open to change this if there is no progress in docker-library/mysql#318 in the next months 🙂

@alexander-schranz
Copy link
Member

alexander-schranz commented Feb 16, 2021

The only problem I see we are not official testing against mariadb and we recommend mysql in our docs and a comming guide. Does somebody know the inpact of the platform flag:

Reference: https://stackoverflow.com/questions/65456814/docker-apple-silicon-m1-preview-mysql-no-matching-manifest-for-linux-arm64-v8#answer-65592942

Addition:

Think the problems here is in docker itself as Apple M1 is ARM but supports also x86_64 over its emulation layer, docker should fallback to the x86_64 if the ARM is not available, the platform flag seems to force that it will use the x86_64 image which Apple M1 does support. From the official docker docs: https://docs.docker.com/docker-for-mac/apple-m1/ they recommend --platform linux/amd64 for this images.

@mario-fehr
Copy link

mario-fehr commented Feb 16, 2021

@TheCadien can you try this by adding the platform flag. I don't have an M1 from Apple, so I cannot test it myself.

mysql:
    platform: linux/x86_64
    image: mysql:8.0.19
    ...

@TheCadien
Copy link
Member Author

@mfehr94 It basically looks like it will work, I can definitely create a Docker container with it and access it.
However, the container seems to be extremely slow.
Doctrine even returns me only the following as an error.

`In AbstractMySQLDriver.php line 115:

An exception occurred in driver: SQLSTATE[HY000] [2006] MySQL server has gone away`

And like @alexander-schranz i'm not really sure what the plattform tag is.

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