Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Docker v2 Beta can't handle env file without "=" after variable name #1917

@potiuk

Description

@potiuk

Description

When you specify --env-file filename.env for the new docker-compose and the env file contains just variable names without "=" afterwards, the docker-compose command fails with "Can't separate key from value"

Steps to reproduce the issue:

  1. Create _docker.env file with this content in a directory where you have a docker-compose file:
VARIABLE
  1. Run docker-compose up --env-file ${PATH}/_docker.env

Describe the results you received:

The command fails with Can't separate key from value error

Describe the results you expected:

  • It should not fail
  • If VARIABLE is not defined in host, it should not be present in the container
  • If VARIABLE is defined in host, it should be set in the container to the same value

Additional information you deem important (e.g. issue happens only occasionally):

Seems that adding = after the variable fixes the problem:

VARIABLE=

This issue was first discovered in apache/airflow#16949 and workarounded in apache/airflow#16950 by @oyarushe for Apache Airflow.

**Output of docker-compose --version: ***

v2.0.0-beta.6

Output of docker version:

Docker Desktop: 3.5.2 on MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: regression ↩️A new version of the app broke something.compatibilityCompatibility with docker-compose

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions