如何设置DOCKER_HOST? [英] how to set the DOCKER_HOST?

查看:97
本文介绍了如何设置DOCKER_HOST?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过以下链接进行django-shop教程: https://django-shop.readthedocs.io/zh-CN/latest/tutorial/quickstart.html .我在docker,docker-compose和linux中是一个新手.

I was doing the django-shop tutorial from this link:https://django-shop.readthedocs.io/en/latest/tutorial/quickstart.html . I am very new in docker ,docker-compose and linux .

我收到此错误:

错误:无法通过 http://127.0.0.1:2375 连接到Docker守护程序-是它正在运行?

ERROR: Couldn't connect to Docker daemon at http://127.0.0.1:2375 - is it running?

如果它位于非标准位置,请使用DOCKER_HOST环境变量.

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

当我执行这些命令时...

When I execute these commands...

$ git clone --depth 1 github.com/awesto/django-shop 
$ cd django-shop 
$ export DJANGO_SHOP_TUTORIAL=commodity 
$ docker-compose up --build -d

我试图做这个教程,但是没有用.

I tried to do this Tutorial and this didn't work.

编辑:我使用此命令来解决此问题:

EDIT: I use this Command to solve this problem:

$ sudo adduser razvan docker

$ sudo adduser razvan docker

推荐答案

通常,请勿设置 DOCKER_HOST .

鉴于您的错误消息,它看起来好像被设置了(不正确),并且您可能会发现情况是否变好了

Given your error message, it looks like it might be set (incorrectly) and you might see if things get better if you

unset DOCKER_HOST

两个显着的例外是基于VM的Docker环境(Docker Toolbox,Docker Machine,Kubernetes的minikube).在这些情况下,可以使用帮助程序脚本将其设置为正确的值:

The two prominent exceptions are VM-based Docker environments (Docker Toolbox, Docker Machine, Kubernetes' minikube). In these cases there are helper scripts that can set it to the correct value:

eval $(docker-machine env)   # Docker Machine, Docker Toolbox
eval $(minikube docker-env)  # Minikube

这篇关于如何设置DOCKER_HOST?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆