Skip to content

Commit

Permalink
Errors out instead of trying to workaround buggy docker-compose v2 (#…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
potiuk authored and Cloud Composer Team committed Aug 27, 2022
1 parent 35efae2 commit 5f4083a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 71 deletions.
16 changes: 16 additions & 0 deletions breeze
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,22 @@ function breeze::prepare_command_file() {
local compose_file="${3}"
cat <<EOF >"${file}"
#!/usr/bin/env bash
docker_compose_version=\$(docker-compose --version)
if [[ \${docker_compose_version} =~ .*version\ 2.* ]]; then
echo
echo "${COLOR_RED}Docker Compose Beta version 2has bug that prevents breeze from running.${COLOR_RESET}"
echo "${COLOR_RED}You have: \${docker_compose_version}.${COLOR_RESET}"
echo
echo "${COLOR_YELLOW}Please switch to stable version via Docker Desktop -> Experimental or by running:${COLOR_RESET}"
echo
echo "${COLOR_CYAN}docker-compose disable-v2${COLOR_RESET}"
echo
echo "${COLOR_YELLOW}Also please upvote https://github.com/docker/compose-cli/issues/1917${COLOR_RESET}"
echo
echo "${COLOR_RED}Exiting until you disable v2 version.${COLOR_RESET}"
exit 1
fi
if [[ \${VERBOSE} == "true" ]]; then
echo
echo "Executing script:"
Expand Down
70 changes: 0 additions & 70 deletions scripts/ci/docker-compose/_docker_compose.env

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/ci/docker-compose/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
- KUBECONFIG=/files/.kube/config
- HOST_HOME=${HOME}
env_file:
- _docker_compose.env
- _docker.env
volumes:
# Pass docker to inside of the container so that Kind and Moto tests can use it.
- /var/run/docker.sock:/var/run/docker.sock
Expand Down

0 comments on commit 5f4083a

Please sign in to comment.