faradayio / cage

Develop and deploy complex Docker applications
http://cage.faraday.io
Apache License 2.0
307 stars 26 forks source link

Provide arguments to cage shell label? #107

Closed neezer closed 3 years ago

neezer commented 4 years ago

I'd love to be able to set my default shell for my PostgreSQL container to

services:
  pg:
    labels:
      io.fdy.cage.shell: "psql -U postgres"

... but it appears cage treats that string as the name of the executable. It works for my redis container because I don't need to provide arguments. Not providing arguments means psql tries to login as root instead of postgres which yields an authentication failure. I've also tried setting the environment variables POSTGRES_USER and PGPASSWORD but the cage shell command seems to ignore those.

emk commented 3 years ago

I would normally recommended creating a shell script that calls Postgres with the right arguments, and using that as your "shell."

neezer commented 3 years ago

Ok, I’ll give that approach a shot.