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 3 years have passed since last update.

[Docker]ERROR: no matching manifest for linux/arm64/v8 in the manifest list entriesについて

Posted at

はじめに

本記事では、ERROR: no matching manifest for linux/arm64/v8 in the manifest list entriesの解決方法を記述します。

コード

docker-compose.yml
version: '3'
services:
  db:
    image: mysql:8.0
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - ./src/db/mysql_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password

  web:
    build: .
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - ./src:/app
    ports:
      - "3000:3000"
    depends_on:
      - db
Dockerfile
FROM ruby:2.7

ENV RAILS_ENV=production

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
  && echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
  && apt-get update -qq \
  && apt-get install -y nodejs yarn
WORKDIR /app
COPY ./src /app
RUN bundle config --local set path 'vendor/bundle' \
  && bundle install

COPY start.sh /start.sh
RUN chmod 744 /start.sh
CMD [ "sh", "/start.sh" ]

ターミナルにて

% docker-compose run web rails new . --force --database=mysql
Creating network "rails_docker_default" with the default driver
Pulling db (mysql:8.0)...
8.0: Pulling from library/mysql
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries

ERROR: no matching manifest for linux/arm64/v8 in the manifest list entriesというエラーが発生しました。

結論

M1チップ問題でした。

何が良くて、何にエラーが出るのかイマイチわからないです。。

platform: linux/x86_64を追記しました。

docker-compose.yml
version: '3'
services:
  db:
    platform: linux/x86_64 # M1チップ対応のため追記
    image: mysql:8.0
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - ./src/db/mysql_data:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: password

  web:
    build: .
    command: bundle exec rails s -p 3000 -b '0.0.0.0'
    volumes:
      - ./src:/app
    ports:
      - "3000:3000"
    depends_on:
      - db

ターミナルにて再度コマンド入力し、成功しました!

以上です。

終わりに

M1チップ問題なかなかややこしいですね。
随時対応していきましょう。

以下参考サイトです。
M1 Macでno matching manifest for linux/arm64/v8が発生した

明日も頑張ります。

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?