Skip to content

.env load values with double quotes escaped #721

@aventrax

Description

@aventrax

Describe the bug

I think there a bug that were on docker-compose some time ago.

As stated here, the variables declared on the dotenv can be quoted or not. A simple string does not require anything, as well as an integer, but with a whitespace we need to use some kind of quotes.

NAME="Mike White"
AGE=33

Within a container created by docker compose, this happens:

root@65e1bca70a68:/app# echo $NAME
Mike White
root@65e1bca70a68:/app# echo $AGE
33

BUT, within a podman container created by podman-compose, this happens:

root@10f2d76c465a:/app# echo $NAME
"Mike White"
root@10f2d76c465a:/app# echo $AGE
33

To Reproduce

.env

NAME="Mike White"
AGE=33

docker-compose.yaml

version: "3.7"

services:
  app:
    build:
      context: .
      dockerfile: ./Dockerfile
    env_file: .env

podman-compose up -d

Enter the container interactively, type echo $NAME

Expected behavior
The double quotes should have been stripped

Actual behavior
The double quotes are there

Output

$ podman-compose version
podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.4.1
podman-compose version 1.0.6
podman --version
podman version 4.4.1
exit code: 0

$ podman-compose up
...

Environment:

  • OS: Linux RHEL 8.8
  • podman version: 4.4.1
  • podman compose version: 1.0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions