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

mac m1 fail to build mysql #2969

Closed
Jayj1997 opened this issue May 8, 2021 · 7 comments
Closed

mac m1 fail to build mysql #2969

Jayj1997 opened this issue May 8, 2021 · 7 comments

Comments

@Jayj1997
Copy link

Jayj1997 commented May 8, 2021

Description:

try to use laradock to start mysql, I run
docker-compose up -d mysql
then this showed up
ERROR: Service 'mysql' failed to build : Build failed

I use mac mini m1 big sur, is it caused by mac os ? I tried this command on ubuntu20.04 and windows wsl and both fine

Context information:

failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:04ee7141256e83797ea4a84a4d31b1f1bc10111c8d1bc1879d52729ccd19e20a: not found
ERROR: Service 'mysql' failed to build : Build failed

Output of docker version

Client:
 Cloud integration: 1.0.14
 Version:           20.10.6
 API version:       1.41
 Go version:        go1.16.3
 Git commit:        370c289
 Built:             Fri Apr  9 22:46:57 2021
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.6
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       8728dd2
  Built:            Fri Apr  9 22:44:13 2021
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker-compose version

docker-compose version 1.29.1, build c34c88b2
docker-py version: 5.0.0
CPython version: 3.9.0
OpenSSL version: OpenSSL 1.1.1h  22 Sep 2020

System info: Mac, Windows or Linux. Include which disto/version

mac mini m1 big sur

Stacktrace & Additional info:

worked well on redis, same command
@simeranjitbrar
Copy link

I see the same issue on my m1 mac mini as well.

@bestlong
Copy link
Member

bestlong commented May 19, 2021

mysql does not seem to be supported yet.

try mariadb

@Jayj1997
Copy link
Author

mysql does not seem to be supported yet.

try mariadb

I see the same issue on my m1 mac mini as well.

this error seems related to m1 chip, I munually installed arm64 version of mysql on my mac instead of docker.

btw, I tried official docker mysql, still doesn't support m1 chip,

but I still don't know why, isn't docker run mysql in a linux simulator(i think)?

@hfuccillo
Copy link

You can just add this to docker-compose.yml

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

My service looks like this:


mysql:
      image: mysql:8.0.19
      platform: 'linux/x86_64'
      build:
        context: ./mysql
        args:
          - MYSQL_VERSION=${MYSQL_VERSION}
      environment:
        - MYSQL_DATABASE=${MYSQL_DATABASE}
        - MYSQL_USER=${MYSQL_USER}
        - MYSQL_PASSWORD=${MYSQL_PASSWORD}
        - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        - TZ=${WORKSPACE_TIMEZONE}
      volumes:
        - ${DATA_PATH_HOST}/mysql:/var/lib/mysql
        - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
      ports:
        - "${MYSQL_PORT}:3306"
      networks:
        - backend
      user: mysql

@Jayj1997
Copy link
Author

You can just add this to docker-compose.yml

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

My service looks like this:


mysql:
      image: mysql:8.0.19
      platform: 'linux/x86_64'
      build:
        context: ./mysql
        args:
          - MYSQL_VERSION=${MYSQL_VERSION}
      environment:
        - MYSQL_DATABASE=${MYSQL_DATABASE}
        - MYSQL_USER=${MYSQL_USER}
        - MYSQL_PASSWORD=${MYSQL_PASSWORD}
        - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        - TZ=${WORKSPACE_TIMEZONE}
      volumes:
        - ${DATA_PATH_HOST}/mysql:/var/lib/mysql
        - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
      ports:
        - "${MYSQL_PORT}:3306"
      networks:
        - backend
      user: mysql
``

thanks for help, this works, but why should this work :(, Im confusing

@shashinvision
Copy link

You can just add this to docker-compose.yml

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

My service looks like this:


mysql:
      image: mysql:8.0.19
      platform: 'linux/x86_64'
      build:
        context: ./mysql
        args:
          - MYSQL_VERSION=${MYSQL_VERSION}
      environment:
        - MYSQL_DATABASE=${MYSQL_DATABASE}
        - MYSQL_USER=${MYSQL_USER}
        - MYSQL_PASSWORD=${MYSQL_PASSWORD}
        - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        - TZ=${WORKSPACE_TIMEZONE}
      volumes:
        - ${DATA_PATH_HOST}/mysql:/var/lib/mysql
        - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
      ports:
        - "${MYSQL_PORT}:3306"
      networks:
        - backend
      user: mysql

This was a solution for my problem with mac air M1 :D Thank you so much

@LHXHL
Copy link

LHXHL commented Oct 22, 2021

您可以将其添加到 docker-compose.yml

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

我的服务看起来像这样:


mysql:
      image: mysql:8.0.19
      platform: 'linux/x86_64'
      build:
        context: ./mysql
        args:
          - MYSQL_VERSION=${MYSQL_VERSION}
      environment:
        - MYSQL_DATABASE=${MYSQL_DATABASE}
        - MYSQL_USER=${MYSQL_USER}
        - MYSQL_PASSWORD=${MYSQL_PASSWORD}
        - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        - TZ=${WORKSPACE_TIMEZONE}
      volumes:
        - ${DATA_PATH_HOST}/mysql:/var/lib/mysql
        - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
      ports:
        - "${MYSQL_PORT}:3306"
      networks:
        - backend
      user: mysql

it was a solution for my problem wtih my macbook air,:),thanks so much!

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

No branches or pull requests

6 participants