mitchellh / boot2docker-vagrant-box

Packer scripts to build a Vagrant-compatible boot2docker box.
424 stars 183 forks source link

How can I use docker command in the OSX terminal? #68

Closed zhaozhiming closed 9 years ago

zhaozhiming commented 9 years ago

HI, I have set the DOCKER_HOST, but how can I use docker command in the OSX terminal? Use boot2docker installer can use docker in the OSX terminal.

Thank you.

OSX terminal console:

Zhaos-MacBook-Pro:ceph-manager-client zhaozhiming$ echo $DOCKER_HOST
tcp://192.168.59.103:2375
Zhaos-MacBook-Pro:ceph-manager-client zhaozhiming$ docker version
-bash: docker: command not found
Zhaos-MacBook-Pro:ceph-manager-client zhaozhiming$ ping 192.168.59.103
PING 192.168.59.103 (192.168.59.103): 56 data bytes
64 bytes from 192.168.59.103: icmp_seq=0 ttl=64 time=0.522 ms
64 bytes from 192.168.59.103: icmp_seq=1 ttl=64 time=2.896 ms
64 bytes from 192.168.59.103: icmp_seq=2 ttl=64 time=0.284 ms

my Vagrant file:

# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "boot2docker"
  config.vm.network :private_network, ip: "192.168.59.103"
end
dduportal commented 9 years ago

Hi @zhaozhiming !

this image will only take care to launch a b2d VM.

You can install the docker client (which is the same binary as the server) from the official docker website, or from homebrew.

Another solution in a full-vagrant setup is to "vagrant ssh" inside the vm and use the docker client inside boot2docker.

zhaozhiming commented 9 years ago

OK, thank you.