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 :

  • How do you list volumes in docker containers?
  • Dockerignore: Ignore everything except a file and the Dockerfile
  • Git init with symlinks
  • Docker : How are intermediate containers formed
  • shared folder doesn't contain data
  • How to push a docker image to a private repository
  • 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

  • How to use the docker remote API?
  • Does Alpine Linux handle certs differently than Busybox?
  • Can’t delete image with children
  • Changes to css, js, and static files not reflected on nginx docker container
  • Build context folder in a remote registry?
  • Accessing Docker for Mac via Remote Access API
  • 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.