"/etc/container_environment" permissions issue
matsuro-hadouken opened this issue ยท 4 comments
FROM phusion/baseimage:master
Container quit instantly after start, following errors are in a log:
_*** Killing all processes...
Traceback (most recent call last):
File "/sbin/my_init", line 414, in
main(args)
File "/sbin/my_init", line 330, in main
import_envvars(False, False)
File "/sbin/my_init", line 90, in import_envvars
for envfile in listdir("/etc/container_environment"):
File "/sbin/my_init", line 74, in listdir
return sorted(os.listdir(path))
PermissionError: [Errno 13] Permission denied: '/etc/container_environment'
Expected behavior:
Container doesn't quit after start and keep internal service active.
I meet the same error, from an old image I just rebuild.
Did you discover the problem and the solution?
I've found the same after upgrading from the 18.04 to the focal version of baseimage (Thanks for producing it).
My image worked fine before, and failed with this error.
My Dockerfile sets the USER to a non-root user at the end of it; the directory is set to 700 so I guess that's causing the problem.
My workaround was to comment out that change of user in the Dockerfile, then it worked fine.
Glad you got it working, closing.