1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Apple Silicon(M1, M2) MacBookAirでDocker上にMySQLサーバを立てる

Posted at

自分用のメモになりますので、早速結論を書く。
何か誤りがありましたら、編集リクエストかコメント下さい。

Dockerfileの場合

FROM --platform=linux/arm64/v8 mysql/mysql-server:latest

# 追加で実行する処理(参考)
ENV TZ=Asia/Tokyo
ENV MYSQL_ROOT_PASSWORD=password
COPY ./docker/mysql/my.cnf /etc/mysql/conf.d/my.cnf
COPY ./docker/mysql/initdb.d /docker-entrypoint-initdb.d

docker-composeの場合

docker-compose.yml
version: '3'
services:
  mysql:
    image: mysql/mysql-server:latest
    platform: linux/arm64/v8
    environment:
      MYSQL_ROOT_PASSWORD: password
    ports:
      - 127.0.0.1:3306:3306
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?