4

I want to run a Bitnami container on Apple M1. My question is about Bitnami Moodle, however, I suspect my problem to be rather general as it occurs when starting Apache.

error message:

(95)Operation not supported: AH00023: Couldn't create the mpm-accept mutex

I added platform: linux/amd64 and added a Dockerfile:

from docker-compose.yml

moodle:
  platform: linux/amd64
  build:
    context: .
    dockerfile: ./Dockerfile
  image: bitnami/moodle:4

Dockerfile (see this source):

FROM bitnami/moodle
RUN echo 'Mutex posixsem' >>/opt/bitnami/apache2/conf/httpd.conf

I also tried adding the --platform argument when building: docker build --no-cache --platform=linux/amd64 .

None of this helps. I can see relevant output when running docker build . ([2/3] RUN echo 'Mutex posixsem' ...), but I keep getting the same error when running docker-compose up.

Is there anything else I could try?

Pida
  • 928
  • 9
  • 32

1 Answers1

1

I put this problem aside for a while, but this is the relevant (and working) part from docker-compose.yml we are currently using with Linux, as well as M1 and M2 MacBooks.

services:
  moodle:
    platform: linux/x86_64
    container_name: foo_moodle
    depends_on:
      - moodle_db
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8080:8080"
      - "8443:8443"
    restart: unless-stopped
    environment:
      - MOODLE_DATABASE_TYPE=pgsql
      - MOODLE_DATABASE_HOST=moodle_db
      - MOODLE_DATABASE_PORT_NUMBER=5432
      - MOODLE_DATABASE_USER=${MOODLE_DB_USER}
      - MOODLE_DATABASE_NAME=${MOODLE_DB_NAME}
      - MOODLE_DATABASE_PASSWORD=${MOODLE_DB_PASS}
      - MOODLE_SITE_NAME=${MOODLE_SITE_NAME}
    volumes:
      - ./moodle/mount_moodle:/bitnami/moodle
      - ./moodle/mount_moodle_data:/bitnami/moodledata

  moodle_db:
    platform: linux/x86_64
    image: bitnami/postgresql:14
    container_name: foo_moodle_db
    restart: unless-stopped
    ports:
      - 54322:5432
    environment:
      - POSTGRESQL_USERNAME=${MOODLE_DB_USER}
      - POSTGRESQL_PASSWORD=${MOODLE_DB_PASS}
      - POSTGRESQL_DATABASE=${MOODLE_DB_NAME}
    volumes:
      - ./moodle/mount_moodle_db:/bitnami/postgresql

Dockerfile:

FROM bitnami/moodle:4.1.2

# Needed to work on Mac
# Some credit goes to: https://www.linode.com/community/questions/16977/server-fails-after-installing-certbot-mpm-run-failed-exiting#answer-66578
RUN echo 'Mutex posixsem' >>/opt/bitnami/apache2/conf/httpd.conf
Pida
  • 928
  • 9
  • 32