When building on Kaniko the /var/run/postgresql directory is not preserved because Kaniko excludes /var/run by default due to Kubernetes secrets (and others) stored in /var/log. Creating the directory in /run directly will not exclude the directory and will copy it out to the final image. This works because /var/run is a symlink to /run. Tested with a Kaniko build on docker, a Gitlab runner on NRP-Nautilus, and a bare Docker container.
When building on Kaniko the /var/run/postgresql directory is not preserved because Kaniko excludes /var/run by default due to Kubernetes secrets (and others) stored in /var/log. Creating the directory in /run directly will not exclude the directory and will copy it out to the final image. This works because /var/run is a symlink to /run. Tested with a Kaniko build on docker, a Gitlab runner on NRP-Nautilus, and a bare Docker container.