boot2docker - docker error: /var/run/docker.sock: no such file or directory -
i new docker. have shell script loads data impala , want docker file runs builds image , run container. on mac, installed boot2docker , have docker_host env set up.
bash-3.2$ docker info containers: 0 images: 0 storage driver: aufs root dir: /mnt/sda1/var/lib/docker/aufs dirs: 0 execution driver: native-0.2 kernel version: 3.15.3-tinycore64 debug mode (server): true debug mode (client): false fds: 10 goroutines: 10 eventslisteners: 0 init path: /usr/local/bin/docker sockets: [unix:///var/run/docker.sock tcp://0.0.0.0:2375] i trying installed pre-built image using:
sudo docker pull busybox i error:
sudo docker pull busybox 2014/08/18 17:56:19 post http:///var/run/docker.sock/images/create?fromimage=busybox&tag=: dial unix /var/run/docker.sock: no such file or directory
is wrong docker setup?
when docker pull busybox, pulls image , download complete.
bash-3.2$ docker pull busybox pulling repository busybox a9eb17255234: download complete fd5373b3d938: download complete d200959a3e91: download complete 37fca75d01ff: download complete 511136ea3c5a: download complete 42eed7f1bf2a: download complete c120b7cab0b0: download complete f06b02872d52: download complete 120e218dd395: download complete 1f5049b3536e: download complete bash-3.2$ docker run busybox /bin/echo hello doctor hello doctor am missing something?
you don't need run docker commands sudo when you're using boot2docker every command passed boot2docker vm runs root default.
you're seeing error when you're running sudo because sudo doesn't have docker_host env set, user does.
you can confirm doing a:
$ env then a
$ sudo env and looking docker_host in each output.
as having docker file runs script, might work you:
dockerfile
from busybox # copy script docker image add /path/to/your/script.sh /usr/local/bin/script.sh # run script cmd /usr/local/bin/script.sh then can run:
docker build -t your-image-name:your-tag . this build docker image, can see doing a:
docker images then, run container, can a:
docker run your-image-name:your-tag this run command start container image created dockerfile , build command , finish once script.sh has finished executing.
Comments
Post a Comment