-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add set docker host by current context #9094
chore: add set docker host by current context #9094
Conversation
Codecov Report
@@ Coverage Diff @@
## main #9094 +/- ##
==========================================
- Coverage 70.48% 63.43% -7.06%
==========================================
Files 515 628 +113
Lines 23150 32293 +9143
==========================================
+ Hits 16317 20484 +4167
- Misses 5776 10248 +4472
- Partials 1057 1561 +504
... and 431 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I was looking into the alternative way to simplify the whole var opts = []client.Opt{client.WithHTTPHeaders(getUserAgentHeader())}
cli, err := command.NewDockerCli()
if err != nil {
return nil, nil, fmt.Errorf("fail to create dockerCli instance %w", err)
}
err = cli.Initialize(flags.NewClientOptions())
if err != nil {
return nil, nil, fmt.Errorf("fail to initialize dockerCli instance %w", err)
}
endpoint := cli.DockerEndpoint()
clientOpts, err := endpoint.ClientOpts()
if err != nil {
return nil, nil, fmt.Errorf("fail to get dockerCli endpoint options %w", err)
}
opts = append(opts, clientOpts...)
c, err := client.NewClientWithOpts(opts...) |
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
`make extension-up` fails with: ``` Checking cache... - eu.gcr.io/gardener-project/gardener/extensions/registry-cache: Error checking cache. getting imageID for eu.gcr.io/gardener-project/gardener/extensions/registry-cache:v0.1.0-34-g935efc92-dirty: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? ``` For a long time I was performing the following workaround: ``` % sudo ln -s "$HOME/.docker/run/docker.sock" /var/run/docker.sock ``` It seems that the issue is fixed permanently in `[email protected]` with GoogleContainerTools/skaffold#9094. skaffold should now be able to correctly determine to location of the docker socket.
Fixes: #9028
golang docker rest api client
use a hard coded value as docker engine host for example,unix:///var/run/docker.sock
on mac,but docker command line client
use the socket fromdocker current context
as host.docker current context
with docker client, if the DOCKER_HOST is not set, we should use the value fromdocker current context
. If the value is set, both docker command line and golang rest client will honor the env variable.