-
Notifications
You must be signed in to change notification settings - Fork 2k
Feature request: set default machine name arg #1694
Comments
It actually already has a concept of the active Docker vm based on which one you've exported env variables for. |
We used to do this but it proved a lot of work and potential problems as a feature of Machine is multiple machine management. We removed it for those reasons. Thanks for the feedback! |
I see. Thanks for the info! On Sat, 15 Aug 2015 3:26 am Evan Hazlett notifications@github.com wrote:
|
@ehazlett would you be able to go into more detail on why you closed this? It's really redundant to have docker-machine error out on these commands when you actually only have one machine – it's not particularly good UX at the moment IMO. It's the same as if Whether it can just figure out the name automatically, or it just reads it from a config you provide that provides a default machine name, it would certainly be much more usable with this feature and save a lot of keystrokes (and users forgetting that they have to provide a name, and trying to remember what that name was, etc) |
FWIW, I agree that reasonable defaults always make for better UX, but for the lack of such defaults in the current version of the Docker Machine CLI, this is what I did to maintain my relative sanity, in case it's helpful to anybody: alias dm-ssh='docker-machine ssh `docker-machine active`'
alias dm-ip='docker-machine ip `docker-machine active`'
alias dm-env='docker-machine env `docker-machine active`'
alias dm-inspect='docker-machine inspect `docker-machine active`'
alias dm-config='docker-machine config `docker-machine active`' |
thanks @inadarei! |
I've create this bash script called "dm" that injects the default docker machine name into commands that are supported by the script. The default machine name is taken from dm ssh This will run The supported commands are The script will not inject the default machine name if a supported command is not used as the first arguments or if there's a use of an existing machine name in the command. You can add |
This makes sense coming from boot2docker where we only work with a single vm instance and thus only do
boot2docker ip
,boot2docker ssh
, etcMaybe it can be the static
default
machine that the installer creates when migrating from boot2docker?Or perhaps a command-line
docker-machine set-default <name>
?Or maybe a new env var
$MACHINE_DEFAULT_NAME
Let me know your thoughts. Thanks!
The text was updated successfully, but these errors were encountered: