Skip to content
This repository has been 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

Closed
potiuk opened this issue Jul 12, 2021 · 19 comments · Fixed by #2002
Closed

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

potiuk opened this issue Jul 12, 2021 · 19 comments · Fixed by #2002
Labels
bug: regression ↩️ A new version of the app broke something. compatibility Compatibility with docker-compose

Comments

@potiuk
Copy link

potiuk commented Jul 12, 2021

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
@potiuk
Copy link
Author

potiuk commented Jul 13, 2021

This workaround with adding = also has proven to break regular docker --env-file command. Previously, the same env file without = could be used for both docker-compose an docker but when you use the same pattern for docker env-file those variables get EMPTY:

VARIABLE=

@potiuk
Copy link
Author

potiuk commented Jul 13, 2021

Because of this docker-compose and docker different behaviour this is a major issue.

potiuk added a commit to potiuk/airflow that referenced this issue Jul 13, 2021
The apache#16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.
potiuk added a commit to apache/airflow that referenced this issue Jul 13, 2021
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.
potiuk added a commit to potiuk/airflow that referenced this issue Jul 14, 2021
Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917
potiuk added a commit to apache/airflow that referenced this issue Jul 14, 2021
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917
@ndeloof
Copy link
Collaborator

ndeloof commented Jul 16, 2021

need to check how https://pypi.org/project/python-dotenv/ and https://github.com/joho/godotenv differ for this specific syntax, and propose a fix

@ndeloof
Copy link
Collaborator

ndeloof commented Jul 16, 2021

python-dotenv explicitely consider lack of an equal sign as "value: none"
https://github.com/theskumar/python-dotenv/blob/master/src/dotenv/parser.py#L156-L160

ruby's dotenv parser don't declare the equal sign as optional
https://github.com/bkeepers/dotenv/blob/c237d6d6291c898d8affb290b510c7aac49aed71/lib/dotenv/parser.rb#L19

Based on this I'm not sure godotenv would accept a PR to ignore a missing separator?

I also need to tell I don't really understand how usefull name without a value is in a .env file, as it would then be resolved from os.Env IIUC but compose variables are already resolved by os.Env so this has no actual effect. If anyone can give me some more detail on the way they rely on this...

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

This is all about passing variables to INSIDE the container, not compose variables.

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

We heavily rely on it in Apache Airflow: https://github.com/apache/airflow/blob/main/scripts/ci/docker-compose/_docker.env
We run a "development" tool called breeze which prepares set of environment variables based on the input and then passes all those variables to inside of the Airflow container.

We alse have some scenarios (mostly CI-based) when we use the same airflow image and run a specific command - but we do not need docker compose for that as we only need to spin that single image.

In the first case our docker-compose has this:
https://github.com/apache/airflow/blob/1960e37952efc08ad33328ff511a846f2376ad4f/scripts/ci/docker-compose/base.yml#L28

In the second case we pass the same env file to a docker run command via "extra args":
https://github.com/apache/airflow/blob/1960e37952efc08ad33328ff511a846f2376ad4f/scripts/ci/libraries/_initialization.sh#L274

All those are based on values already set by previous steps in the script (based on the user flags) or environment variables set in CI

For example here is how they are set from user input:

https://github.com/apache/airflow/blob/1960e37952efc08ad33328ff511a846f2376ad4f/breeze#L792

And here we set a number of those env vars in CI: https://github.com/apache/airflow/blob/1960e37952efc08ad33328ff511a846f2376ad4f/.github/workflows/ci.yml#L31

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

For now I had to actually warn the users to disable v2 :( until the problem is solved:

https://github.com/apache/airflow/blob/1960e37952efc08ad33328ff511a846f2376ad4f/breeze#L594

Happy to help testing it when it is fixed :)

@ndeloof ndeloof added bug: regression ↩️ A new version of the app broke something. compatibility Compatibility with docker-compose labels Jul 16, 2021
@ndeloof
Copy link
Collaborator

ndeloof commented Jul 16, 2021

not very pleasant, but a possible short term workaround is to use FOO=${FOO} syntax in your dotEnv file to make it explicit value is inherited from local environment

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

Not sure if that would work for docker case, but yeah. Worth checking! thanks for the suggestion.

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

Yep. works in both cases! Thanks for the suggestion @ndeloof - I will workaround it this way for now!

UPDATE: I must have been doing something wrong. The workaround does not work with docker's --env-file :(

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

Easy fix: sed 's/\(^[^#=]*\)$/\1=${\1}/' -i _docker.env :)

@ndeloof
Copy link
Collaborator

ndeloof commented Jul 16, 2021

fixing joho/godotenv won't be trivial, as we can't just consider FOO (no equal sign) to be equivalent to FOO=${FOO}. with the latter, is FOO env variable is not set, container is set with FOO variable set to an empty string. While it should have FOO variable unset.

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

fixing joho/godotenv won't be trivial, as we can't just consider FOO (no equal sign) to be equivalent to FOO=${FOO}. with the latter, is FOO env variable is not set, container is set with FOO variable set to an empty string. While it should have FOO variable unset.

That's correct. That's how it worked so far

@potiuk
Copy link
Author

potiuk commented Jul 16, 2021

BTW. I am fine with Airflow with using FOO=${FOO} because I deliberately made a choice of not relying on variable being set/unset but on its value. So even binary variables for me have "true"/"false" value and check is != "true" - precisely for the reason.

potiuk added a commit to potiuk/airflow that referenced this issue Jul 16, 2021
The docker-compose v2 parsing of env file bug detected
in apache#16949 and eventual disabling of docker-compose-v2 in apache#16989
found another workaround after discussing with docker-compose
maintainers in docker-archive/compose-cli#1917

The VAR=${VAR} pattern seems to work for all cases for Airflow
because we never rely on the fact if variable is set or not -
we always take into account value of the variable (that is by
design and strictly followed everywhere). Therefore we are
sure this workaround is going to work for us.

However we should remove that workaround once the bug is fixed in
Docker-Compose V2.
@potiuk
Copy link
Author

potiuk commented Jul 17, 2021

Actualy I just double-checked and tried it again and it DOES NOT work in docker :(. So it should be fixed.

The error here https://github.com/apache/airflow/pull/17052/checks?check_run_id=3087380066 was caused by PACKAGE_FORMAT got the "unexpected" value of "${PACKAGE_FORMAT}". Since PACKAGE_FORMAT value is set in that step to "wheel", the only explanation I find is that the the docker used does not resolve those values as env variables (and actually docker documentation does not even mention that it can do it). I just double-checked it and well... yeah:

export PACKAGE_FORMAT=wheel
[jarek:~/code/airflow] ± docker run -it  --env-file scripts/ci/docker-compose/_docker.env apache/airflow:2.1.2  bash
airflow@352e19876bd7:/opt/airflow$ set | grep PACKAGE_FORMAT
PACKAGE_FORMAT='${PACKAGE_FORMAT}'

potiuk added a commit to potiuk/airflow that referenced this issue Oct 4, 2021
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)
@potiuk
Copy link
Author

potiuk commented Oct 4, 2021

Seems that we have very similar issues for Linux v2 just released

potiuk added a commit to apache/airflow that referenced this issue Oct 5, 2021
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 27, 2021
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

(cherry picked from commit 72781c0b4548d35a37fbbef9c2417f94d2025f8f)

GitOrigin-RevId: 373007b28f543d7c4e7537c7b8be4d5916346ccd
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Nov 27, 2021
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

(cherry picked from commit 97ae0f2bf36033a69e6221b569d063f856491571)

GitOrigin-RevId: 5f3b53f2e8e79bd109effdb56cedabbf9aec9486
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Mar 10, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Mar 10, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Mar 10, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 4, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 4, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jun 4, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 10, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 10, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
kosteev pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jul 10, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Aug 27, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Aug 27, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Aug 27, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 4, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 4, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 4, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 7, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 7, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
aglipska pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Oct 7, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 7, 2022
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 7, 2022
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Dec 7, 2022
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 27, 2023
The #16950 aimed to fix an incompatibility introduced by
beta version of docker-compose v2 (which is automatically pushed
to MacOS users now).

The issue is documented in
docker-archive/compose-cli#1917

Unfortunately it has an undesired side-effect that the same file
cannot be used to specify list of variables for docker command
(the variables come empty).

Until the problem is solved, we need to keep two copies of those
variable files. Not ideal, but hopefully the issue will be solved
soon and we can go back to original env file in docker-compose v2.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 27, 2023
…16989)

Docker-Compose v2 Beta has an error in processing environment
variable file which prevents Breeze from running. Until it is
fixed, we are going to print an error, explain how to disable
it and exit - because the workaround introduces more problems
than it solves (passing environment variables to container
is broken partially)

Also see docker-archive/compose-cli#1917

GitOrigin-RevId: 97ae0f2bf36033a69e6221b569d063f856491571
leahecole pushed a commit to GoogleCloudPlatform/composer-airflow that referenced this issue Jan 27, 2023
Docker-compose 2 on linux introduced a number of problems and
incompatibilities:

* version is printed in different format
* -f flag was failing after --log-level info was passed
* environment variables were not correctly passed with _docker.env
  with missing values

All those worked fine in 1.29.2 and even in MacOS version of
docker-compose 2 (after raising and fixing some bugs by us
docker-archive/compose-cli#1917

This PR:

* fixes version regexp
* removes --log-level info
* adds copy of _docker.env with var="${var} assignments specifically
  for docker-compose (duplicated variables but this works as a
  workaround)

GitOrigin-RevId: 2630341d0f5088215798719a5418a3e77abbc5c7
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: regression ↩️ A new version of the app broke something. compatibility Compatibility with docker-compose
Projects
None yet
3 participants