Question: Its baffling how one get host ip address on windows (boot2docker) by just issuing this command: docker-machine ip

But same doesn't work on ubuntu using same command. It always says :
"docker-machine: command not found"

Any idea on why its not working? or is there different command to find the host ip while running ubuntu as the host machine os and docker host?

Answer: 
Instead of using docker-machine commands you could use regular docker commands.

For example if you run the following container

```
docker run --name some-postgres -p 5432:5432 -d postgres

```

You can access the container through localhost in port 5432 or you can use docker inspect to find the containers IP

```
docker inspect --format '{{ .NetworkSettings.IPAddress }}' some-postgres

```
If you need to install docker-machine, the installation instructions are on [the release page](https://github.com/docker/machine/releases/). So for the 0.8 release, the install command is:

```
curl -L https://github.com/docker/machine/releases/download/v0.8.0/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine && \
  chmod +x /usr/local/bin/docker-machine

```

That command needs to be run as root, so `sudo -s` first if you are logged in as a user. Docker-machine isn't typically installed on Linux unless you're using it to spin up some development machines in the cloud since Docker itself is directly installed on the OS rather than as a VM running boot2docker.

---

Edit: if you just need your ip address on linux, there are a variety of solutions for a linux host. `ip a` is the quick method to list all the local interfaces and the associated addresses.