shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[BUG] Docker-Compose db(mysql) image not support arm64(Raspberry Pi 4 Model B) architecture

Open myesn opened this issue 3 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Docker-Compose file:

master/shenyu-dist/shenyu-docker-compose-dist/src/main/resources/stand-alone-mysql/docker-compose.yaml

Operation system version:

ubuntu@ubuntu:~/apache-shenyu/shenyu-master$ uname -a
Linux ubuntu 5.4.0-1055-raspi #62-Ubuntu SMP PREEMPT Wed Mar 2 14:43:34 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

Running on Raspberry Pi 4 Model B(arm64):

ubuntu@ubuntu:~/apache-shenyu/shenyu-master$ docker-compose up -d
Pulling db (docker.io/mysql:5.7)...
5.7: Pulling from library/mysql
5.7: Pulling from library/mysql
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries

Expected Behavior

Make it work, thanks.

Steps To Reproduce

An error occurs after executing the following command:

curl https://raw.githubusercontent.com/apache/incubator-shenyu/master/shenyu-dist/shenyu-docker-compose-dist/src/main/resources/install.sh | bash -s master mysql

Environment

ShenYu version(s): 2.4.2

Debug logs

No response

Anything else?

Using the biarms/mysql:5.7.30-linux-arm64v8 image in our project can run successfully.

myesn avatar Apr 01 '22 03:04 myesn

Do you have any good solutions?

yu199195 avatar Apr 01 '22 03:04 yu199195

I think we need to write different docker-compose.yml file for different CPU architectures, and then modify the install.sh script to execute different docker-compose.yml file for different CPU architectures, with pseudo code like:

Step 1:

docker-compose-x64.yml   -- lots of OS-dependent services for x64
docker-compose-arm.yml   -- lots of OS-dependent services for arm

Step 2:

kind = ""

switch os.architecture:
  case x64:
    kind = "x64"; break;    
  case arm64:
    kind = "arm64"; break;
  default:
      throw error("not supported");

docker-compose -f docker-compose-${kind}.yml up -d

Here are some references:

myesn avatar Apr 01 '22 06:04 myesn

Using the biarms/mysql:5.7.30-linux-arm64v8 image in our project can run successfully.

Hi, I think we can change mysql to mariadb which support both amd64 and arm64 arch.

image

JooKS-me avatar Apr 01 '22 07:04 JooKS-me

Hi, I think we can change mysql to mariadb which support both amd64 and arm64 arch.

It should work, I haven't used mariadb, all I know is that it's a mysql based distribution.

But now there is a new problem, the shenyu-admin and shenyu-bootstrap are not working properly(on arm64 architecture), I created a new issue #3166 to illustrate this new problem.

myesn avatar Apr 01 '22 08:04 myesn

I change the image to mariadb in #3210.

However, it is not recommended to use docker-compose to start mysql directly. I think we can remove the mysql part and let the user configure the mysql address and account password directly.

JooKS-me avatar Apr 07 '22 15:04 JooKS-me