Is there a technical reason for why Docker secrets are not being supported when the container is run in Docker compose but only in swarm mode?
After using PiHole on a RPI for years, I am currenlty trying out setting it up using the Docker container for the first time. And I am doing so with Docker compose. And so I've hit the issue of how to configure the admin credential via Docker Secrets, when using Compose.
It seems that the implementation of file based secrets, via the WEBPASSWORD_FILE parameter is ONLY being used when the container is run in swarm mode (when attempting to use the content of the secret file to log into the PiHole admin portal the password is not being accepted).
At least that seems to be what I gather from other discussions on this forum:
However, nowhere can I find the rational behind only supporting secrets when running in swarm mode.
It can't be due to secrets not being a supported feature in compose:
To give a complete example, the following secret named pihole_password is fully available inside the container given the Docker compose configuration below:
As was mentioned in my question above, "..I am doing so with Docker compose". Not using swarm in any way.
Docker secrets are indeed not just a feature of Docker Swarm, but also a completely supported feature of Docker Compose. Please see the following link to Docker's own documentation, that was part of my question above.
As an example of a project using Docker secrets for a container running in compose, please see Nextcloud's container documentation.
Fair enough, what is named "Docker Secrets" is a swarm only feature. Using secrets is not a swarm only feature (please see my link above referencing Docker's own documentation). The naming strategy of Docker in this regard is abysmal.
Moving on from splitting hairs on that, the initial question stands:
Is there a technical reason for why the pihole container does not use file based secrets (such as these) unless they are the swarm only Docker secrets (such as these)?
I agree Docker's documentation is not as clear as it could be on that matter.
Lack of proper understanding may have contributed to WEBPASSWORD_FILE having been dropped in and out of v6 during beta phase, perhaps regarding it as little used when exclusively a Docker swarm feature.
Thank you for clarifying it's available with plain docker compose as well.