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 to replicate microservices when consuming same kafka topic?
  • WebSphere Docker OAuth
  • Howto run a Prestashop docker container with persistent data?
  • Create a ASP.net Core project with Docker Support for Windows
  • serving multiple docker microservices behind nginx proxy
  • Docker Container CPU Usage
  • bash-3.2$ docker run hello-world
    

    An error occurred trying to connect: Post https://192.168.59.103:2376/v1.19/containers/create: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103

    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://192.168.59.103:2376
    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

  • nginx proxy from port 80 to other ports
  • Using Nginx as micro service API gateway
  • docker with wildfly HA in domain mode
  • Django in Docker using PyCharm
  • Weird error while running docker command “no such file or directory”
  • Make 2 volumes in docker gcc and java
  • 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.

    TL;DR

    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.