-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docker-composer postgres env vars #141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Please use Going back to |
I have the same issue. I tried what you suggested and on both commands I found that env variables are considered still doesn't have effect This is a portion of "Config": {
"Hostname": "3bb47abf0e9e",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"5432/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"POSTGRES_PASSWORD=menui.st",
"POSTGRES_USER=mnst",
"POSTGRES_DB=menuist",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=en_US.utf8",
"PGDATA=/var/lib/postgresql/data"
],
"Cmd": [
"postgres"
],
"Image": "kiasaki/alpine-postgres:9.5",
"Volumes": {
"/var/lib/postgresql/data": {}
},
"WorkingDir": "",
"Entrypoint": [
"/docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "6c2c6409ac9c27382cbe9f5ae635a5049657ecf8bdc9d9eeb307850620391da0",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "menuist",
"com.docker.compose.service": "postgres",
"com.docker.compose.version": "1.7.1"
}
} This is a portion of compose.service.create_container: Creating menuist_postgres_1
compose.cli.verbose_proxy.proxy_callable: docker create_container <- (name=u'menuist_postgres_1', image='kiasaki/alpine-postgres:9.5', labels={u'com.docker.compose.service': u'postgres', u'com.docker.compose.project': u'menuist', u'com.docker.compose.config-hash': '6c2c6409ac9c27382cbe9f5ae635a5049657ecf8bdc9d9eeb307850620391da0', u'com.docker.compose.version': u'1.7.1', u'com.docker.compose.oneoff': u'False', u'com.docker.compose.container-number': '1'}, host_config={'NetworkMode': u'menuist_default', 'Links': [], 'PortBindings': {'5432/tcp': [{'HostPort': '5432', 'HostIp': ''}]}, 'Binds': [u'menuist_database:/var/lib/postgresql/data:rw'], 'RestartPolicy': {u'MaximumRetryCount': 0, u'Name': u'always'}, 'LogConfig': {'Type': u'', 'Config': {}}, 'VolumesFrom': []}, environment=[u'POSTGRES_PASSWORD=menui.st', u'POSTGRES_USER=mnst', u'POSTGRES_DB=menuist'], volumes={u'/var/lib/postgresql/data': {}}, detach=True, ports=['5432'], networking_config={u'EndpointsConfig': {u'menuist_default': {u'IPAMConfig': {}, u'Aliases': ['postgres']}}})
compose.parallel.feed_queue: Pending: set([])
compose.cli.verbose_proxy.proxy_callable: docker create_container -> {u'Id': u'3bb47abf0e9ec5623f51f197a79c07458477941092fdc73ad189abfdfb1a9a02',
u'Warnings': None} |
@erwagasore, did you start your postgres container before setting some of the env args? Docker-compose will try hard to keep volumes around when recreating the container, so the entrypoint script from the official image would not apply any of those arguments on an already initialized database. You are also using |
Seems to be similar to #203, so this #203 (comment) might apply as well. Closing old issue. |
Hi all
I'm trying to bring up a postgres container with docker-compose, while setting custom
POSTGRES_*
vars.However, when I run
docker-compose --verbose up
it doesn't look like all the env vars are being passed through:It looks like only the password is being set. Indeed, when I connect in from outside the docker ecosystem, I need to use
postgres
as the username,postgres
as the db, andpony
works as the password.Any suggestions as to what I could be doing wrong, or is it a bug?
The text was updated successfully, but these errors were encountered: