Comments (14)
The first option is the only viable long term option (or a similar solution, i.e. not environment based) as I see it. As otherwise machine ls
will be misleading with regard to which one is currently the active one. Perhaps machine ought to look at DOCKER_HOST
(or whatever other config option will be in the future) to determine the current active machine, to avoid confusion.
from machine.
Here is a previous proposal about how this could work: moby/moby#7232
from machine.
Here's a comment on that proposal explaining the requirements for Machine: moby/moby#7232 (comment)
from machine.
I think integration into Docker Engine would be best. However, I think to create a better user experience we should do the env vars config for the interim. This has bit me multiple times :)
from machine.
+1 for the env vars via machine config
for now.
from machine.
However, it would perhaps be more advantageous for people to have this instead:
Zsh:
_machine_env_hook() {
export DOCKER_HOST=$(machine url) DOCKER_AUTH=identity`
}
typeset -ag precmd_functions
if [[ -z $precmd_functions[(r)_machine_env_hook] ]]; then
precmd_functions+=_machine_env_hook;
fi
Bash:
_machine_env_hook() {
export DOCKER_HOST=$(machine url) DOCKER_AUTH=identity`
}
if ! [[ "$PROMPT_COMMAND" =~ _machine_env_hook ]]; then
PROMPT_COMMAND="_machine_env_hook;$PROMPT_COMMAND";
fi
We could make machine config
output that for now...
from machine.
If we're going to do machine config
then I think that:
- it needs a better name that makes it clear that it's outputting a shell script
- it should just output
export DOCKER_HOST=tcp://x.x.x.x:2376 DOCKER_AUTH=identity
from machine.
@bfirsh Firstly, perhaps config-shell
Secondly, if it just outputs an export, one would have to restart their shell for it to pick it up, creating the workflow of:
- machine create ...
- exit shell
- reopen shell
- docker run ...
from machine.
True.
I think we should aim to get Machine to automatically configure Docker. This is a hack which can use as a last resort.
from machine.
For that, we need docker to be changed to allow for your proposal from moby/moby#7232
from machine.
I'd propose $(machine shellinit)
only because thats what boot2docker
has had, so many users are used to it.
from machine.
For now, we are using the machine config
command (not shell init as it just passes args to the Docker CLI and nothing in the environment) and swarm is doing the same. The long term solution is support in the engine.
from machine.
+1
Also, I may have created a duplicate (or augmentation) to this issue yesterday: #1416
from machine.
I am closing this issue as I think it's "as good as it's going to get" in Machine right now and further solutions would mandate support in Docker itself.
from machine.
Related Issues (20)
- zsh: command not found: docker error (my first installation) HOT 1
- Failed to create machine on local ubuntu 18.04
- Skip provisioning when creating a machine HOT 1
- Errors on docker-machine ls with high count of machines (~450)
- This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory HOT 1
- Docker cli does not work with ssh connection? HOT 1
- docker stop <machinename> Maximum number of retries (60) exceeded HOT 1
- create with driver hyperv gets stuck on ssh due to ssh private key permissions
- ~ HOT 1
- [google] Unable to locate package docker-ce-rootless-extras HOT 1
- hine ls HOT 1
- flag provided but not defined: -profile HOT 1
- Update Dockerfile HOT 1
- docker-machine echo fail
- Docker machine for arm64 architecture (Apple M1) HOT 3
- Error creating machine: Error in driver during machine creation: /usr/local/bin/VBoxManage sharedfolder add default --name hosthome --hostpath /home --automount failed:
- Powershell instance not properly detected when spawned from Command Prompt
- amazonec2 driver should not use spot blocks
- Is this project alive? HOT 5
- How to get newest docker engine on MacOS with open-source Docker? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from machine.