Closed michael-lins closed 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
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.
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!"
Description
The docker compose up -d --build command fails with message:
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):
Process
./docker/setup.sh
executableThe console should output the following messages:
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 detailsfound 216 vulnerabilities (16 low, 87 moderate, 94 high, 19 critical) run
npm audit fix
to fix them, ornpm audit
for details [+] Building 0.0s (0/0) docker:desktop-linux [+] Building 0.0s (0/0) docker:desktop-linux10% 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
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!
[+] Running 0/1 ⠦ da_mysql Pulling 2.5s no matching manifest for linux/arm64/v8 in the manifest list entries
$ docker compose up -d --build