Skip to content

Possible minor bug: Service port definition syntax in production.yml #768

@felix-caboff

Description

@felix-caboff

Describe the bug
I regularly get errors when using the CLI that tells me that the port definitions are invalid. They are relatively simple to fix by hand but I thought I would ask the question in case I am missing something / this is actually a real bug (albeit a minor one).

An example of the YAML in question is:

    build:
      context: .
...SNIP...
    environment:
      - NO_PROXY=django,graphql_engine
      - POSTGRES_DB=${POSTGRES_DB}
      - POSTGRES_HOST=${POSTGRES_HOST}
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
      - POSTGRES_PORT=${POSTGRES_PORT}
      - POSTGRES_USER=${POSTGRES_USER}
...SNIP...
    expose:
      - "${POSTGRES_PORT}:5432"

The error is:

Error response from daemon: invalid JSON: invalid port '5432:5432': invalid syntax

So it seems that ${POSTGRES_PORT} is set to 5432 and it also has ":5432" appended which makes it invalid.

To Reproduce
Steps to reproduce the behavior:

  1. Login to the machine and access the CLI
  2. Execute ./ghostwriter-cli-linux backup or similar
  3. See error

Expected Behavior
I think this should "just work".

Our setup
We are running this on an Ubuntu 22.04 host with Docker version 29.0.1 all patched and up to date.

Metadata

Metadata

Labels

bugSomething isn't working

Type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions