Can one bindMount /run in containers?


I’m trying to run nginx, mysql, and two php-fpm (v8 and v5) in three containers.

Container 1: nginx + mysql
Container 2: phpfpm v8
Container 3: php-fpm v5 (cloned phpfpm module and adjusted to support php 5).

I want nginx to proxy to the fpm daemons with a unix domain socket.

For some undisclosed reason, the<name>.socket option is read-only, and hard-coded to use /run/phpfpm as the runtime directory. So, in order to give the nginx container access to the phpfpm socket in the phpfpm v8 container, I’m trying to mount the /run folder of all three containers to the same host folder /srv/antique-web-app/run.

However, all three containers fail to start with the message:

Feb 13 13:07:50 nixos-test systemd[1]: Failed to start Container 'antique-web-app-phpm80'.
Feb 13 13:07:50 nixos-test container antique-web-app[27593]: Failed to mount n/a (type n/a) on /run/host (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_REMOUNT|MS_BIND ""): No such file or directory

The host folder exists. I have a host systemd service that starts before the containers to create the /srv/antique-web-app/run folder.

I’m not sure why I can’t bind mount /run inside the container. Can someone shed some light on what’s going on here?