Can't set docker-machine environment variables bash

I’ using bash 4.3 and I can’t export or set docker-machine environment variables

bash-4.3$ docker-machine env default
set -gx DOCKER_TLS_VERIFY "1";
set -gx DOCKER_HOST "tcp://192.168.99.100:2376";
set -gx DOCKER_CERT_PATH "/Users/ofolorunso/.docker/machine/machines/default";
set -gx DOCKER_MACHINE_NAME "default";
# Run this command to configure your shell: 
# eval (docker-machine env default)

Apparently bash doesn’t recognize the g flag

  • App in Docker does not update
  • Why does enablePlugins(DockerPlugin) from sbt-docker in Play project give “error: reference to DockerPlugin is ambiguous”?
  • How to build a Docker image for an Arm architecture on a Mac?
  • Understanding docker plugins
  • How to access to Google AppEngine Managed VM logs?
  • ASP.NET Core 1.0 RC1 Docker with dnu publish
  • bash-4.3$ eval "$(docker-machine env default)"
    bash: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    bash: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    bash: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    bash: set: -g: invalid option
    set: usage: set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
    

    I should note that my machine’s default shell is fish

  • libcontainer, runc and nsenter bootstrap
  • mingw in docker container no output
  • CPU multithreading of Caffe in a Docker Container
  • No connection to generic driver
  • How to retrieve the remote IP address using Play! inside a docker container
  • docker container fails to start after docker deamon has been restarted
  • 2 Solutions collect form web for “Can't set docker-machine environment variables bash”

    Have you tried forcing bash with the --shell option?

    docker-machine env --shell bash default
    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST "tcp://192.168.99.100:2376"
    export DOCKER_CERT_PATH "/Users/ofolorunso/.docker/machine/machines/default"
    export DOCKER_MACHINE_NAME="default"
    

    Env variables are set with set -gx in fish and with export in bash.

    Set has no flag -g in bash. I do not know what you’re trying to do with those flags, but if you want to set environment or shell variables, look at this.

    For example, to set a variable use something like this: export ANT_HOME=/path/to/ant/dir

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.