Mac笔记本m1芯片,使用docker 创建mysql的时候容易出现这个错误,解决方法:
添加 platform: linux/x86_64
version: '3.7'
services:
database:
image: 'mysql:5.7'
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: teebblog
ports:
# To allow the host machine to access the ports below, modify the lines below.
# For example, to allow the host to connect to port 3306 on the container, you would change
# "3306" to "3306:3306". Where the first port is exposed to the host and the second is the container port.
# See https://docs.docker.com/compose/compose-file/#ports for more information.
- '8888:3306'
platform: linux/x86_64