Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

$(boot2docker shellinit) frequently fails (OSX) #716

Description

@skozin

Running

$(boot2docker shellinit)

frequently (but not always) produces this error:

-bash: unset: `DOCKER_HOST=tcp://192.168.59.103:2375': not a valid identifier

As a result, DOCKER_HOST is not getting set to the desired value. The output of boot2docker shellinit is the following:

$ boot2docker shellinit
    export DOCKER_HOST=tcp://192.168.59.103:2375
    unset DOCKER_CERT_PATH
    unset DOCKER_TLS_VERIFY

These commands produce no errors when executed directly (by pasting into the command line). I am not sure why command substitution fails.

boot2docker v1.4.1 (Git commit: 43241cb) is installed on OSX 10.10 with GNU Bash 4.3.30(1)-release (x86_64-apple-darwin14.0.0).

This issue seems to be different from #715, as none of my boot2docker-related paths contain whitespace (and there are no paths at all in the shellinit-generated output).

UPD: I just discovered that boot2docker shellinit sometimes produces commands in a different order:

$ boot2docker shellinit
    unset DOCKER_TLS_VERIFY
    export DOCKER_HOST=tcp://192.168.59.103:2375
    unset DOCKER_CERT_PATH

And sometimes, the export line is the last one. It seems that command substitution fails in these cases:

$(echo "
    unset DOCKER_TLS_VERIFY
    export DOCKER_HOST=tcp://192.168.59.103:2375
    unset DOCKER_CERT_PATH
")
# -bash: unset: `DOCKER_HOST=tcp://192.168.59.103:2375': not a valid identifier

$(echo "
    unset DOCKER_TLS_VERIFY
    unset DOCKER_CERT_PATH
    export DOCKER_HOST=tcp://192.168.59.103:2375
")
# -bash: unset: `DOCKER_HOST=tcp://192.168.59.103:2375': not a valid identifier

$(echo "
    export DOCKER_HOST=tcp://192.168.59.103:2375
    unset DOCKER_TLS_VERIFY
    unset DOCKER_CERT_PATH
")
# no error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions