我在ubuntu 14.04
上安装了docker,它运行正常。
etc/default/docker
下的我有这样的配置:
# Docker Upstart and SysVinit configuration file
# Customize location of Docker binary (especially for development testing).
#DOCKER="/usr/local/bin/docker"
# Use DOCKER_OPTS to modify the daemon startup options.
#DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
DOCKER_OPTS="-H unix:///var/run/docker.sock"
# If you need Docker to use an HTTP proxy, it can also be specified here.
#export http_proxy="http://127.0.0.1:3128/"
# This is also a handy place to tweak where Docker's temporary files go.
#export TMPDIR="/mnt/bigdrive/docker-tmp"
我运行docker run hello-world
,然后在var/run/docker.sock
下,文件未被写入。
我如何收听该文件才能使用remote api?
提前致谢。
答案 0 :(得分:1)
如果您看到“Using boot2docker to run Docker on a Mac or Windows”
中显示的错误消息$ docker run hello-world
2014/08/11 15:05:55 Post http:///var/run/docker.sock/v1.13/containers/create: dial unix /var/run/docker.sock: no such file or directory
然后确保已正确设置DOCKER_HOST环境变量 使用docker machine时,应设置为:
docker-machine env dev
一旦完成,那么简单的GET就可以了:
echo -e "GET /images/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock
这使用Netcat utility(nc
命令)。