Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to setup configs with docker-machine. #914

Closed
trmaphi opened this issue May 1, 2019 · 8 comments · Fixed by #998
Closed

How to setup configs with docker-machine. #914

trmaphi opened this issue May 1, 2019 · 8 comments · Fixed by #998
Labels
Milestone

Comments

@trmaphi
Copy link

trmaphi commented May 1, 2019

Currently, I'm on mac os and installed docker-toolbox using brew with version info

~ brew cask info docker-toolbox
docker-toolbox: 18.06.1-ce
https://www.docker.com/products/docker-toolbox
/usr/local/Caskroom/docker-toolbox/18.06.1-ce (205.3MB)
From: https://github.com/Homebrew/homebrew-cask/blob/master/Casks/docker-toolbox.rb
==> Name
Docker Toolbox
==> Artifacts
DockerToolbox-18.06.1-ce.pkg (Pkg)

I read docs on setup with docker-machine. I got the value of docker host from

~ docker-machine env
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/trmaphi/.docker/machine/machines/default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell: 
# eval $(docker-machine env)

Then, I copied DOCKER_HOST value inside global settings.json, but I got message noti from vscode said Unable to connect to Docker. Please make sure you have installed Docker and that it is running. Details: connect ECONNREFUSED 127.0.0.1:80

How do I config my global settings.json to connect this extension with docker-machine

@atomi
Copy link

atomi commented May 3, 2019

I think using DOCKER_HOST is a much better way to do remote builds.
Preferably, a per project setting for DOCKER_HOST, DOCKER_TLS_VERIFY and DOCKER_CERT_PATH will be availble.

Edit: Personally I've been using a Makefile for docker-compose --build up

build:
	@ eval $$(docker-machine env default); \
	docker-compose up --build -d

@trmaphi
Copy link
Author

trmaphi commented May 22, 2019

@atomi could you show me .vscode/settings.json in your workspace?

I couldn't find any settings options for DOCKER_TLS_VERIFY and DOCKER_CERT_PATH

@atomi
Copy link

atomi commented May 22, 2019

@trmaphi I don't use a .vscode/settings.json file.
By the way VSCode also passes environment variables set in your shell.
So you can set them there also.

@PrashanthCorp
Copy link
Contributor

Is this an issue only with the tree view, or are commands sent to shell affected too?

We rely on dockerode for populating the tree view, and we've seen issues ensuring docker_host is honored. We shall look into this.

@ejizba
Copy link
Member

ejizba commented Jun 17, 2019

Hi all - just merged #998 to support the following VS Code settings:

docker.host - equivalent to DOCKER_HOST
docker.certPath - equivalent to DOCKER_CERT_PATH
docker.tlsVerify - equivalent to DOCKER_TLS_VERIFY
docker.machineName - equivalent to DOCKER_MACHINE_NAME

Feel free to try the latest build from master and let us know if it works for ya! See these instructions: https://aka.ms/azCodeInsiders

@atomi
Copy link

atomi commented Jun 19, 2019

@EricJizbaMSFT just to confirm your update works as advertised! Thank you.

@atomi
Copy link

atomi commented Jun 26, 2019

@EricJizbaMSFT @PrashanthCorp The built in terminal appears to not use the DOCKER_* env variables from VS Code settings. I think most people would expect the terminal to honor the DOCKER_* variables set in their settings.

@ejizba
Copy link
Member

ejizba commented Jun 26, 2019

@atomi please create a new issue if you would like that behavior. The built in terminal uses those env vars when we create a terminal for docker commands, but not on every terminal you manually create

@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants