nominatim-docker
nominatim-docker copied to clipboard
Error on M1 Mac: Apache start failed
Describe the bug
The latest Docker image 4.3 can not be started completely on an M1 Mac because the Apache server won't start. It looks like this is caused by problems related to the M1 Max chip.
The older Docker image from Peter Evans works https://github.com/peter-evans/nominatim-docker
To Reproduce
Steps to reproduce the behavior:
Running the older Docker image from Peter Evans works as expected without problems:
$ docker run -d -p 9000:8080 \
-e NOMINATIM_PBF_URL=http://download.geofabrik.de/asia/maldives-latest.osm.pbf \
--name nominatim \
peterevans/nominatim:latest
> <CONTAINER ID>
$ docker logs -f <CONTAINER ID>
...wait until started...
$ curl "localhost:9000/search.php?q=Baros&format=json"
[{"place_id":106254,"licence":"Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright","osm_type":"way","osm_id":116704220,"boundingbox":["4.2834742","4.2859758","73.4259013","73.4282571"],"lat":"4.284732399999999","lon":"73.42723848863355","display_name":"Baros, މާލެ އަތޮޅު, Maldives","class":"place","type":"islet","importance":0.36}]
But when I am trying to run the Mediagis 4.3 Docker image on an M1 Mac (arch shows "i386" as architecture)...
$ arch
i386
$ docker run -it \
-e PBF_URL=http://download.geofabrik.de/asia/maldives-latest.osm.pbf \
-p 9000:8080 \
--name nominatim \
mediagis/nominatim:4.3
...I get the error that Apache can not be started. Even adding the parameter --platform linux/amd64
to the Docker run call does not help
Expected behavior
Docker containing including Apache instance can be started successfully
Screenshots & Logs
The logs show the following error
+ service apache2 start
* Starting Apache httpd web server apache2
[Sun Nov 19 12:35:19.131980 2023] [core:emerg] [pid 1161]
(95)Operation not supported: AH00023: Couldn't create the mpm-accept mutex
(95)Operation not supported: could not create accept mutex
AH00015: Unable to open logs
Action 'start' failed.
Desktop / Server
- OS & Version: MacOS Monterey 12.5.1
- Docker Desktop Version: 4.9.1 (81317)
- Nominatim Version: 4.3
Additional context
Apache can be started if we log into the Docker container while it is still running, add a line to the Apache config and restart the Apache server, as described here
docker exec -it -u 0 nominatim /bin/bash
echo "Mutex posixsem" >> /etc/apache2/apache2.conf
./startapache.sh