The docker preview of M1 Mac came out, so I tested it immediately. I usually develop with WordPress of VPS, but I will try to run it locally. In addition, localbyflywheel is already compatible with Silicon, so If you're just developing WordPress, I think it's easier.
Where you downloaded docker https://www.docker.com/blog/download-and-try-the-tech-preview-of-docker-desktop-for-m1/
reference https://docs.docker.jp/compose/wordpress.html
Create docker-compose.yml in a folder called docker-test and copy and paste from the above reference address
docker-compose.yml
version: '3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
db_data:
$ docker-compose up
Creating network "docker-test_default" with the default driver
Pulling db (mysql:5.7)...
5.7: Pulling from library/mysql
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
While pulling mysql, `` `ERROR: no matching manifest for linux/arm64/v8``` appears.
Check mysql of docker hub
It seems that it doesn't work because it is only x86-64 and there is no arm64.
Check mariadb.
Likely to go. Partially changed docker-compose.yml
docker-compose.yml
version: '3'
services:
db:
image: mariadb
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
volumes:
db_data:
Replaced the db: image part from `mysql: 5.7``` to
`mariadb```
$ docker-compose up
Since there was no error, open localhost: 8000 in a browser.
moved. There was no problem logging in.
In Activity Monitor, Docker Desktop seems to be intel and only Docker core is apple. I haven't run it that much yet, but neither CPU usage nor memory usage is that great. It took a while to start up for the first time, but it's comfortable because the browser is explosive.
Recommended Posts