How to export the docker variables?

I’m new to docker.My Operating system is Mac OS.
I follow the step from docker website,

  1. Download the boot2docker and install it.
  2. run the boot2docker
  3. $ boot2docker init
  4. $ boot2docker start
  5. $ docker run hello-world

the result is that :

  • Docker Tools on Windows Server 2008
  • How to write my own applications on Docker?
  • No Space on CentOS with Docker
  • docker-compose: Modify environment variable
  • Docker images won't start sometime and it error logs says something I cannot understand
  • docker + rails + redis - rescue workers are not running
  • bash-3.2$ docker run hello-world

    An error occurred trying to connect: Post x509: certificate is valid for,, not

    then i do

    $ boot2docker shellinit to display the environment variables

    bash-3.2$ boot2docker shellinit

    Writing /Users/wangyao/.boot2docker/certs/boot2docker-vm/ca.pem

    Writing /Users/wangyao/.boot2docker/certs/boot2docker-vm/cert.pem

    Writing /Users/wangyao/.boot2docker/certs/boot2docker-vm/key.pem

    Your environment variables are already set correctly.

    maybe I think it makes error by not configuring the variables, So I do this

    export DOCKER_HOST=tcp://
    export DOCKER_CERT_PATH=/Users/wangyao/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1

    then I $ boot2docker shellinit, and the result is no different,

    Please tell me how to resolve it

  • connect robomongo to mongoDB docker container
  • Docker overlay networks prevent IP forwarding
  • docker memory-swap=-1 OOM
  • Can travis-ci run docker?
  • Docker: Not a valid repository:
  • Why do I get an authorization error from Docker when I'm trying to pull a public image?
  • One Solution collect form web for “How to export the docker variables?”

    I explained how to use Docker Machine instead of boot2docker, if you’re interested: Can't run docker on os X with boot2docker.

    Because I think Boot2Docker won’t be the recommended way of using Docker (on Windows/OS X) any longer soon.


    docker-machine create -d virtualbox dev
    eval "$(docker-machine env dev)"
    docker run hello-world
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.