webdevops / Dockerfile

:package: Dockerfiles from WebDevOps for PHP, Apache and Nginx
https://webdevops.io/projects/dockerfiles/
MIT License
1.67k stars 492 forks source link

Apache keeps restarting itself on Apple M1 chip #433

Closed erezhod closed 1 year ago

erezhod commented 2 years ago

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!

henriquemattos commented 2 years ago

Could you solve this case somehow?

htuscher commented 2 years ago

No, M1 is currently not supported. There's an open pull request WIP https://github.com/webdevops/Dockerfile/pull/434 but I don't find the time to review and finalize it.

zhaojc commented 2 years ago

No, M1 is currently not supported. There's an open pull request WIP #434 but I don't find the time to review and finalize it.

yes i have the same problem.please try to fix it asap.thank u very much

htuscher commented 1 year ago

Just fixed it be updating gosu and go-replace

thanhtoan1196 commented 3 months ago

@htuscher it still gives error with image: webdevops/php-apache:8.2-alpine