Skip to content

Apache keeps restarting itself on Apple M1 chip #433

@erezhod

Description

@erezhod

I am using the webdevops/php-apache-dev:7.4-alpine image and it works fine on my Intel i7 MacBook Pro.
But when I try running it on Apple's new M1 Max chip, the apached service keeps restarting itself non-stop with the following error:

my_container  | 2021-12-29 08:08:43,063 INFO spawned: 'apached' with pid 596
my_container  | -> Executing /opt/docker/bin/service.d/httpd.d//10-init.sh
my_container  | 2021-12-29 08:08:43,156 INFO success: apached entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
my_container  | [Wed Dec 29 08:08:43.222254 2021] [so:warn] [pid 606:tid 274904324936] AH01574: module slotmem_shm_module is already loaded, skipping
my_container  | [Wed Dec 29 08:08:43.229391 2021] [so:warn] [pid 606:tid 274904324936] AH01574: module socache_shmcb_module is already loaded, skipping
my_container  | [Wed Dec 29 08:08:43.263945 2021] [core:emerg] [pid 606:tid 274904324936] (38)Function not implemented: AH00023: Couldn't create the ssl-cache mutex 
my_container  | AH00016: Configuration Failed
my_container  | 2021-12-29 08:08:43,284 INFO exited: apached (exit status 1; not expected)

This is my Dockerfile:

FROM webdevops/php-apache-dev:7.4-alpine

# For x86_64 architecture. Without it, it doesn't run at all
RUN wget -O "/usr/local/bin/go-replace" "https://github.com/webdevops/goreplace/releases/download/1.1.2/gr-arm64-linux" \
    && chmod +x "/usr/local/bin/go-replace" \
    && "/usr/local/bin/go-replace" --version

WORKDIR /var/www/html

COPY . .

RUN composer update

EXPOSE 9003

CMD ["supervisord"]

And also on my docker-compose.yml file:

version: "3.8"

services:
  apache2:
    container_name: my_container
    platform: linux/amd64 #For x86_64 architecture
    build:
      context: .
      dockerfile: Dockerfile
    env_file: ./public/.env
    environment:
      docker: "true"
    ports:
      - 8080:8080
    networks:
      - default
    volumes:
      - .:/var/www/html
      - logs:/var/www/html/logs

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions