[英]Can't set docker-machine environment variables bash
我'使用bash 4.3,我無法導出或設置docker-machine環境變量
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)
顯然bash不識別g
標志
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 ...]
我應該注意到我機器的默認外殼是fish
您是否嘗試過使用--shell
選項強制bash?
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變量在fish中set -gx
,在bash中set -gx
為export
。
Set在bash中沒有標志-g。 我不知道你要對這些標志做什么,但是如果你想設置環境或shell變量,請看看這個 。
例如,要設置變量,請使用以下內容: export ANT_HOME=/path/to/ant/dir
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.