wordpress Docker:苹果芯片M1中的Apache

irlmq6kh  于 2023-03-29  发布在  WordPress
关注(0)|答案(4)|浏览(187)

我有一个docker-compose.yml文件:

version: '1'
services:
  mariadb:
    image: 'docker.io/bitnami/mariadb:10.3-debian-10'
    ports:
      - '3307:3306'
    volumes:
      - ./db:/bitnami/mariadb
    environment:
      - MARIADB_USER=bn_wordpress
      - MARIADB_DATABASE=bitnami_wordpress
      - ALLOW_EMPTY_PASSWORD=yes
  wordpress:
    image: 'docker.io/bitnami/wordpress:5-debian-10'
    ports:
      - '8081:8080'
      - '8444:8443'
    volumes:
      - ./wp:/bitnami/wordpress
    depends_on:
      - mariadb
    environment:
      - MARIADB_HOST=mariadb
      - MARIADB_PORT_NUMBER=3306
      - WORDPRESS_DATABASE_USER=bn_wordpress
      - WORDPRESS_DATABASE_NAME=bitnami_wordpress
      - ALLOW_EMPTY_PASSWORD=yes

在Mac(Intel)和Linux中,我运行docker-compose up,它工作得很完美。
但在Macbook M1中,我为Apple Silicon芯片安装了Docker并更新了rosetta,它在最后提示:

wordpress_1  | wordpress 15:48:36.49 INFO  ==> ** Starting Apache **
wordpress_1  | [Tue Jul 13 15:48:36.652803 2021] [core:emerg] [pid 1] (95)Operation not supported: AH00023: Couldn't create the mpm-accept mutex 
wordpress_1  | (95)Operation not supported: could not create accept mutex
wordpress_1  | AH00015: Unable to open logs

我该如何解决这个问题?感谢您的帮助!

m1m5dgzv

m1m5dgzv1#

platform: linux/amd64运行docker compose(即在QEMU下运行)并没有解决这个问题。相反(另外),我必须添加:

Mutex posixsem

httpd.conf

eoigrqb6

eoigrqb62#

有点晚,但你有没有尝试添加platform: linux/amd64?在mariadbwordpress

xtfmy6hx

xtfmy6hx3#

让我分享一个快速解决方案的摘要。
以root用户身份连接到容器

docker exec -it -u 0 <container_name> /bin/bash

更新httpd.conf文件

echo "Mutex posixsem" >> /opt/bitnami/apache2/conf/httpd.conf

重新启动容器

docker restart <container_name>
t0ybt7op

t0ybt7op4#

对于使用m1处理器的设备,您可以在docker-compose中使用platform: linux/arm64

相关问题