Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

extend the boot2docker manage script to set up the DOCKER_HOST env #63

Closed
SvenDowideit opened this issue Jan 9, 2014 · 10 comments
Closed

Comments

@SvenDowideit
Copy link
Contributor

somewhat inspired by https://coderwall.com/p/r6ivdq

ie, ./boot2docker build would pass through to the vm - and start it if needed..

which makes me think the scriptname is too long :)

@steeve
Copy link
Contributor

steeve commented Jan 10, 2014

+1 for the script name length. @shykes has an idea about that :)

@steeve
Copy link
Contributor

steeve commented Jan 10, 2014

however, i'm not really in favor of having a wrapper script really 👎
because then we create non compatible command lines

@bfirsh
Copy link
Contributor

bfirsh commented Jan 16, 2014

👎 a wrapper script. Loads of discussion about this here: julien-duponchelle/docker-osx#25

Though setting DOCKER_HOST is a good idea. With docker-osx, you run docker-osx shell it opens a new shell with DOCKER_HOST set. I'm not sure I like this though – I keep on forgetting to open a shell. It either needs to make it really clear that it is a magical Docker shell, or maybe it could set the env var automatically with launchd or something like that.

I wonder how other OS X tools handle stuff like this? Does homebrew set env vars I wonder?

@SvenDowideit
Copy link
Contributor Author

mmm, I wonder if a trivial solution to this, is to have boot2docker start export DOCKER_HOST=tcp://:$DOCKER_PORT.

oh, and have boot2docker init think about downloading the docker client if its not already on your system.

super magical :)

@moul
Copy link
Contributor

moul commented Jan 24, 2014

The boot2docker start export DOCKER_HOST=tcp://:$DOCKER_PORT, won't stay after the end of the script, so we need to store it

Another solution is to use socat, this is working but need sudo

# sudo socat UNIX-LISTEN:/var/run/docker.sock,reuseaddr,fork,mode=777 TCP-CONNECT:boot2docker:4243
# unset DOCKER_HOST
# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
...

👍 boot2docker init downloading the docker client is a good idea :)

@aheissenberger
Copy link
Contributor

if boot2docker cmd is used as a wrapper it can export the variable vor each call to docker - e.g. :
boot2docker cmd version

to get a shorter command people can use alias

@steeve
Copy link
Contributor

steeve commented Jan 26, 2014

I guess we're going to have to rename the boot2docker script to something shorter then.

@aheissenberger
Copy link
Contributor

I would only add a hint to the README FAQ part that everyone is free to shorten the call by adding alias b2dc='boot2docker cmd' to their bash setup config

@aheissenberger
Copy link
Contributor

I also like the way brew suggest some todos after a successful install - e.g. adding export DOCKER_HOST=tcp://:locahost to the bash config

@SvenDowideit
Copy link
Contributor Author

The OSX installer has a magic icon that starts everything and sets the env. More work is ongoing in http://github.com/boot2docker/boot2docker-cli

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants