Closed nextdayflight closed 2 months ago
It seems like USER is a reserved environment variable in phusion/baseimage.
See https://github.com/phusion/baseimage-docker/blob/master/image/bin/my_init#L81 and https://github.com/phusion/baseimage-docker/commit/18a7fe26ec13235db66e37e9c0f3ca24bc0116ed
I had the same problem, and modified the first line in first_run.sh
to: USER=${DB_USER:-super}
, and then set the username through the DB_USER environment variable instead.
YES, USER has been ignored. just run the container, and check the /sbin/my_init, on line 81: if name in ['HOME', 'USER', 'GROUP', 'UID', 'GID', 'SHELL']: continue
so, just change the variables, and rebuild.
+1 Had to do what @heyman said, clone this repo, fix first_run.sh and build the docker image
I've fixed this issue in my fork https://github.com/lanrat/docker-postgresql See https://github.com/lanrat/docker-postgresql/commit/4a20359bc9cab9c53720dfa65afd91ba3a39515d
Using the latest image (bbpsrhag7rw7a4b6nrcy5hg on Ubuntu 14.04.1/Docker 1.2.0), providing the USER environment variable seems to have no effect, and it will default to 'super'.