Skip to content

Got error "Expected to decode Int but found Scalar instead." if i use an env var in an assignment to "replicas" #95

@ar4hc

Description

@ar4hc

Hi,

stumbled upon this:

Error: DecodingError.typeMismatch: expected value of type Int. Path: services.<oo.deploy.replicas. Debug description: Expected to decode Int but found Scalar instead.

when running

container-compose up --env-file .env -f compose.yml

Relevant parts of the Docker compose yaml looks like this

    deploy:
      mode: replicated
      replicas: ${CORES}

and in .env is

CORES=1

(not CORES="1")

I assume the Decoder looks at this before the variable is resolved...?
So it seed the string "${CORES}" instead of the "1", as the value, from the .env file?

Can i work around this somehow? (other than hard coding the values in the compose file...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions