Skip to content

Avoid ending up with double quoted variables in docker. #545

Open
@woutervh

Description

@woutervh

Related to the buggy way docker handles env-files
see docker/cli#3630 (comment)

When you quote variables in your .env (which IHMO is a best practice):

FOO=BAR
FOO1='BAR1'
FOO2="BAR2"

and then you run docker via docker run --env-file .env
you end up with literal quoted variables inside docker:

FOO=BAR
FOO1='BAR1'
FOO2="BAR2"

This is incorrect, and should be fixed in docker.

and in python via python-dotenv, they become double quoted variables


>>> os.getenv("FOO")
'BAR'

>>> os.getenv("FOO1")
"'BAR1'"

>>> os.getenv("FOO2")
'"BAR2"'

As a work-around for the root-cause, could be avoid ending up with double-quoted variables in python?

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