Skip to content

Building docker-compose files may choke on env_files with spaces #903

@jcfj

Description

@jcfj

Quick problem reproducer:

echo '{"services":{"scratch":{"build":".","env_file":["env"]}},"version":"3"}' >docker-compose.yaml
echo FROM alpine >Dockerfile
echo asdf=bsdf -csdf >env
docker buildx bake

Fails with

[+] Building 0.0s (0/0)                                                                                                                                                      
error: unexpected character "-" in variable name near "-csdf\n"

but builds and runs fine with docker-compose build.
The problem is likely that the env parser treats the env file as space separated, where it is actually line separated (and anyway bake shouldn't have to care, since the env file is only used during execution).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions