Skip to content

psql: the default CMD of --help is mildly inconvenient #22

Description

@SpecLad

The underlying psql tool can be run with no arguments, in which case it will connect to the database defined by the PG* environment variables.

However, the same thing isn't possible with the alpine/psql image, because the Dockerfile contains CMD ["--help"], so running the image with no arguments just gives you the help output:

$ docker run -ti --rm alpine/psql
psql is the PostgreSQL interactive terminal.

Usage:
  psql [OPTION]... [DBNAME [USERNAME]]
[...]

This means that you can't configure the Docker container with just environment variables - at least the database name has to be specified as a command-line argument.

It's not the end of the world, but I would still appreciate if you removed the default CMD. That way, the default behavior would match the underlying psql tool. One could still get the help message by passing --help explicitly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions