Merge pull request #155 from jesseduffield/docker_env

Respect Environment Variables
This commit is contained in:
Dawid Dziurla 2019-08-25 19:20:39 +02:00 committed by GitHub
commit febfce995c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,7 +68,12 @@ func (c *DockerCommand) NewCommandObject(obj CommandObject) CommandObject {
// NewDockerCommand it runs docker commands
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
cli, err := client.NewClientWithOpts(client.WithVersion(APIVersion))
opts := []func(*client.Client) error{
client.WithVersion(APIVersion),
client.FromEnv,
}
cli, err := client.NewClientWithOpts(opts...)
if err != nil {
return nil, err
}