forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support DOCKER_HOST variable passing to Breeze commands (apache#36011)
In some cases you might want to override the default way how Docker determines where to connect by seting DOCKER_HOST variable. This is generally working out of the box by having the variable set, but then it does not work well with `--builder` settings in `builder` plugin. This PR adds support for DOCKER_HOST to be added to all shell and build commands by disabling the builder when the variable is set and explicit forwarding of the DOCKER_HOST variable when running docker commands. You can also override the DOCKER_HOST variable via `--docker-host` command line switch. Build arguments in Breeze commands have been sorted as well as their click options as the command option list grew large enough to be messy if they are not alphabetically sorted. We also add automated support for docker-in-docker case which we use in some tests - the Docker-In-Docker should now work in most cases even if you set DOCKER_HOST: * if the ~/.docker/run/docker.sock is used - we change the mapping of socket to /var/run/docker.sock * if DOCKER_HOST is not a "unix://" socket, we pass it through (hoping it will **just** work as tcp:// or ssh:// - named pipes are not forwardeable anyway) * if Rootless Docker is used, we follow the rootless docker standard for XDG_RUNTIME_DIR/docker.sock (fallback to /run/(UID)/docker.sock Without DOCKER_HOST we just forward /var/run/docker.sock which should work also on MacOS - with, or without root-owned socket.. This gets a litte tricky because the way it works on MacOS / DockerDesktop is a little magicalx. If you set DOCKER_HOST manually to point to your HOME_DIR socket, you are actually supposed to forward `/var/run/docker.sock` not the original socket because mappings you define on MacOS are actually the VM mappings (and your home dir is mounted to VM - EXCEPT the docker socket which is available on the VM as /var/run/docker.sock) More about it in this issue: docker/for-mac#6529 Also docs about MacOS Docker: https://docs.docker.com/desktop/mac/permission-requirements/
- Loading branch information
Showing
24 changed files
with
452 additions
and
258 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
"--docker-cache", | ||
"--version-suffix-for-pypi", | ||
"--build-progress", | ||
"--docker-host", | ||
], | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ | |
"--docker-cache", | ||
"--version-suffix-for-pypi", | ||
"--build-progress", | ||
"--docker-host", | ||
], | ||
}, | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.