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

  • Docker compose and concurrent integration testing
  • Cannot set up Kubernetes local cluster via Docker
  • Strange state of docker on Windows
  • Setting environment variables when running docker in detached mode
  • Access source container from recipient container
  • How to pull image from custom docker registry with golang?
  • 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

  • Using docker volume with a NFS partition
  • run docker under supervisor, can not enable tty error
  • pika.BlockingConnection() failing inside containers, works well within VMs
  • Docker: Run an arbitrary command from inside a priveleged container on the host
  • Docker on AWS filling up its thin pool while running somehow?
  • How to fix docker so that it stops messing with android studio from connecting to emulator in OSX
  • 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.