Closed gtridr closed 6 months ago
Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.
Your step 4 is not a proper test, as services get access to the whole container environment.
root@669d52339515:/usr/lib/unifi# env | grep mongo-user
FILE__MONGO_USER=/run/secrets/mongo-user
root@669d52339515:/usr/lib/unifi# /usr/bin/with-contenv env | grep mongo-user
MONGO_USER=mongo-user
FILE__MONGO_USER=/run/secrets/mongo-user
Your step 4 is not a proper test, as services get access to the whole container environment.
root@669d52339515:/usr/lib/unifi# env | grep mongo-user FILE__MONGO_USER=/run/secrets/mongo-user root@669d52339515:/usr/lib/unifi# /usr/bin/with-contenv env | grep mongo-user MONGO_USER=mongo-user FILE__MONGO_USER=/run/secrets/mongo-user
Oof. Thank you. I was trying to be so thorough. I'll revise & see what I can come up with
This issue has been automatically marked as stale because it has not had recent activity. This might be due to missing feedback from OP. It will be closed if no further activity occurs. Thank you for your contributions.
I suppose I must have been missing something. I'll keep trying to reproduce, but my problem may have been with mongo, not the unifi application. thank you for the reply, sorry to waste your time. If i can find time to reproduce I will at least reply with a comment explaining my issue
This issue is locked due to inactivity
Is there an existing issue for this?
Current Behavior
init-envfile
from the base image seems to run, pulls values from/run/secrets
files, and even creates corresponding files in/run/s6/container_environment/
, but those values never get set as actual environment vars inside the container, causing the sed commands unifi init script to populate system.properties with invalid an invalid mongodb uri.I may be missing something, and this is relatively low priority, but the image is not behaving as documented in some way or another. I'm not sure if this is a problem with the unifi image specifically, or if it inherits this behavior from upstream.
I did find this issue & also this one citing similar behavior, but I am able to confirm that there are no trailing newlines in any of the secret files, even after being passed into the container.
The values even make it into
/proc/<pid>/environ
somehow, (without \n chars) but they aren't accessible as ENVs in the containerExpected Behavior
the values should be made into actual environment vars, such that they are accessible by later init scripts
Steps To Reproduce
create docker secret files on the host; in this case, say
.mongo-user
and.mongo-pass
pass docker secret to container in docker-compose.yml using documented "FILE__" syntax
env-init script finds and evaluates, log output is as follows:
run
docker exec unifi-app env
, output is as follows:run
docker exec unifi-app ls /run/s6/container_environment
, output is as follows:Environment
CPU architecture
x86-64
Docker creation
Container logs