Skip to content

Bake not accepting string for published port in Yaml #1032

Description

@ciaranmcnulty

docker compose config will normalise a port mapping like:

    ports:
      - 3306:3306

to this:

    ports:
    - mode: ingress
      target: 3306
      published: "3306"
      protocol: tcp

Trying to pipe this into buildx bake 0.8.0 hits an error:

error: failed to parse -: parsing yaml: services.mysql.ports.0.published must be a integer, parsing hcl: -.hcl:17,11-12: Invalid character; Single quotes are not valid. Use double quotes (") to enclose strings., and 13 other diagnostic(s)

The compose-spec allows either int or string here, because it's supposed to be able to support a range like "3306-3310" - I guess compose is choosing to always output string

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