MobMin / digital_atlas

A detailed overview of the digital and spiritual landscape for the countries of the world.
GNU General Public License v3.0
17 stars 5 forks source link

07-10-2024: No matching manifest for linux/arm64/v8 in the manifest list entries #37

Closed michael-lins closed 1 month ago

michael-lins commented 1 month ago

Description

The docker compose up -d --build command fails with message:

No matching manifest for linux/arm64/v8 in the manifest list entries 

Context

I am setting up the project on a MacBook Air M1 with 16GB of RAM running macOS Sonoma (14.5).

Docker version is (Docker Desktop):

╭─░▒▓  ~/mis/r/digital_atlas  on feature/refugee-widget !2 ?1 
╰─ docker -v
Docker version 24.0.6, build ed223bc

Process

  1. Make ./docker/setup.sh executable
    $ chmod +x ./docker/setup.sh`
  2. Execute the setup file
    $ ./docker/setup.sh
  3. The console should output the following messages:

    
    ╭─░▒▓    ~/mis/r/digital_atlas  on   feature/refugee-widget !2 ?1 
    ╰─ ./docker/setup.sh                                                    ─╯
    Setting up the dev environment.
    [+] Running 0/1
    ⠸ da_mysql Pulling                                                   3.3s
    no matching manifest for linux/arm64/v8 in the manifest list entries
    [+] Building 0.0s (0/0)                               docker:desktop-linux
    [+] Creating 1/0
    ✔ Network digital_atlas_digital_atlas  Created                       0.0s
    [+] Building 0.0s (0/0)                               docker:desktop-linux
    Installing dependencies from lock file (including require-dev)
    Verifying lock file contents can be installed on current platform.
    Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
    Nothing to install, update or remove
    Generating optimized autoload files
    > Google\Task\Composer::cleanup
    Removing 201 google services
    > Illuminate\Foundation\ComposerScripts::postAutoloadDump
    > @php artisan package:discover --ansi
    
    INFO  Discovering packages.
    
    arrilot/laravel-widgets .......................................... DONE
    laravel/sail ..................................................... DONE
    laravel/sanctum .................................................. DONE
    laravel/tinker ................................................... DONE
    nesbot/carbon .................................................... DONE
    nunomaduro/collision ............................................. DONE
    nunomaduro/termwind .............................................. DONE
    spatie/laravel-ignition .......................................... DONE

83 packages you are using are looking for funding. Use the composer fund command to find out more! [+] Building 0.0s (0/0) docker:desktop-linux [+] Building 0.0s (0/0) docker:desktop-linux npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/watchpack/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm64"})

audited 1148 packages in 3.341s

39 packages are looking for funding run npm fund for details

found 216 vulnerabilities (16 low, 87 moderate, 94 high, 19 critical) run npm audit fix to fix them, or npm audit for details [+] Building 0.0s (0/0) docker:desktop-linux [+] Building 0.0s (0/0) docker:desktop-linux

@2.0.0 dev /var/www/html npm run development

@2.0.0 development /var/www/html cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

10% building 3/3 modules 0 active(node:37) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any time 50% building 44/45 modules 1 active ...ar/www/html/resources/sass/app.scssBrowserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db

Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating 98% after emitting SizeLimitsPlugin

DONE Compiled successfully in 4323ms 8:00:07 PM

                                                                                          Asset      Size                      Chunks             Chunk Names
                                                                                   /css/app.css   253 KiB                     /js/app  [emitted]  /js/app
                                                                                     /js/app.js  1.07 MiB                     /js/app  [emitted]  /js/app
                                                                          /js/filter-widgets.js  11.2 KiB          /js/filter-widgets  [emitted]  /js/filter-widgets
                                                                  /js/jquery.backstretch.min.js  28.6 KiB  /js/jquery.backstretch.min  [emitted]  /js/jquery.backstretch.min

fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.eot?30cc681d4487d2f561035ba24a68c629 131 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.svg?ba7ed552362f64d30f6d844974d89114 730 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.ttf?3b89dd103490708d19a95adcae52210e 131 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff2?f7307680c7fe85959f3ecf122493ea7d 75 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-brands-400.woff?099a9556e1a63ece24f8a99859c94c7d 87.9 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.eot?7630483dd4b0c48639d2ac54a894b450 33.2 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.svg?0bb428459c8ecfa61b22a03def1706e6 141 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.ttf?1f77739ca9ff2188b539c36f30ffa2be 32.9 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff2?f0f8230116992e521526097a28f54066 13 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-regular-400.woff?7124eb50fc8227c78269f2d995637ff5 15.9 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.eot?1042e8ca1ce821518a2d3e7055410839 198 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.svg?376c1f97f6553dea1ca9b3f9081889bd 897 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.ttf?605ed7926cf39a2ad5ec2d1f9d391d3d 198 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff2?e8a427e15cc502bef99cfd722b37ea98 76.4 KiB [emitted] fonts/vendor/@fortawesome/fontawesome-free/webfa-solid-900.woff?9fe5a17c8ab036d20e6c5ba3fd2ac511 99.3 KiB [emitted] [+] Running 0/1 ⠴ da_mysql Pulling 2.6s no matching manifest for linux/arm64/v8 in the manifest list entries [+] Running 0/1 ⠦ da_mysql Pulling 2.5s no matching manifest for linux/arm64/v8 in the manifest list entries Set up completed. Please visit http://localhost:8080/ in your browser. Happy Coding!

4. Although we get a *Happy Coding!* message at the end, the MySQL part of the docker setup was not executed successfully, as we can check the recurring message:

[+] Running 0/1 ⠦ da_mysql Pulling 2.5s no matching manifest for linux/arm64/v8 in the manifest list entries


## Expected result

The docker setup to execute every step successfully, including handling MySQL image properly.

## Current result

MySQL can not be installed.

Trying to solve it by making the build step pass:

$ docker compose up -d --build



## Possible Fix

Still investigating it.
codemis commented 1 month ago

Hi @michael-lins . Ah the joys of M1! The way I got around this is to update the docker-compose.yml file and add the platform to each instance in the file. Just be careful not to push it up to the repo.

version: '3'

networks:
  digital_atlas:

services:
  da_nginx:
    platform: linux/amd64 # mac environment line only
    image: nginx:stable-alpine
    container_name: da_nginx
    ports:
      - "8080:80"
    volumes:
      - .:/var/www/html
      - ./docker/nginx-default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - da_mysql
      - da_php
    networks:
      - digital_atlas

  da_mysql:
    platform: linux/amd64 # mac environment line only
    image: mysql:5.7.22
    container_name: da_mysql
    restart: unless-stopped
    tty: true
    ports:
      - "4306:3306"
    environment:
      MYSQL_DATABASE: homestead
      MYSQL_USER: homestead
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: secret
      SERVICE_TAGS: dev
      SERVICE_NAME: da_mysql
    volumes:
      - ./docker/mysql:/var/lib/mysql
      - ./docker/data:/docker-entrypoint-initdb.d
    networks:
      - digital_atlas

  da_php:
    platform: linux/amd64 # mac environment line only
    hostname: docker-php
    build:
      context: .
      dockerfile: ./docker/php-build
    container_name: da_php
    volumes:
      - .:/var/www/html
    ports:
      - "9000:9000"
    networks:
      - digital_atlas

  da_composer:
    platform: linux/amd64 # mac environment line only
    image: composer:latest
    container_name: da_composer
    volumes:
      - .:/var/www/html
    working_dir: /var/www/html
    entrypoint: ['composer']
    networks:
      - digital_atlas

  da_npm:
    platform: linux/amd64 # mac environment line only
    image: node:13.7
    container_name: da_npm
    volumes:
      - .:/var/www/html
    working_dir: /var/www/html
    entrypoint: ['npm']
    networks:
      - digital_atlas

  da_artisan:
    platform: linux/amd64 # mac environment line only
    build:
      context: .
      dockerfile: ./docker/php-build
    container_name: da_artisan
    depends_on:
      - da_mysql
    volumes:
      - .:/var/www/html
    working_dir: /var/www/html
    entrypoint: ['/var/www/html/artisan']
    networks:
      - digital_atlas
michael-lins commented 1 month ago

I tried some approaches discussed in this Forum, but no MySQL worked as appointed and I was about to try MariaDB, but then I just decided to try lastest, i.e., removing the version and getting the latest version and it worked for my context (pulled mysql:latest).

Even so, I am not sure that we should rely on the latest for the project, therefore I will wait for comments before pushing any PR.

michael-lins commented 1 month ago

My diff for the project is (and also package-lock.json but I ommitted it from the comment):

╭─░▒▓  ~/mis/r/digital_atlas  on  feature/refugee-widget !3 
╰─ git diff
diff --git a/docker-compose.yml b/docker-compose.yml
index f5dfc5f..1b30d5d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -19,7 +19,7 @@ services:
       - digital_atlas

   da_mysql:
-    image: mysql:5.7.22
+    image: mysql
     container_name: da_mysql
     restart: unless-stopped
     tty: true
diff --git a/docker/setup.sh b/docker/setup.sh
index 65c099c..30c0183 100755
--- a/docker/setup.sh
+++ b/docker/setup.sh
@@ -3,11 +3,11 @@
 # development environment for you.

 echo "Setting up the dev environment."
-docker-compose up -d --build
-docker-compose run --rm da_composer install
-docker-compose run --rm da_npm install
-docker-compose run --rm da_npm run dev
-docker-compose run --rm da_artisan migrate
-docker-compose run --rm da_artisan db:seed
+docker compose up -d --build
+docker compose run --rm da_composer install
+docker compose run --rm da_npm install
+docker compose run --rm da_npm run dev
+docker compose run --rm da_artisan migrate
+docker compose run --rm da_artisan db:seed
 echo "Set up completed. Please visit http://localhost:8080/ in your browser."
 echo "Happy Coding!"