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

Docker for Mac (Edge) is not respecting $DOCKER_CONFIG, or $KUBECONFIG environment variable #2635

Closed
lewiscowper opened this Issue Feb 22, 2018 · 10 comments

Comments

Projects
None yet
6 participants
@lewiscowper
Copy link

lewiscowper commented Feb 22, 2018

Expected behavior

Docker doesn't write any config files to ~/.docker, once the DOCKER_CONFIG variable has been set (to some path that is not ~/.docker). Similar situation for ~/.kube and KUBECONFIG.

It'd be awesome to have a setting in Docker for Mac that allowed configuring where configuration files and Volumes etc could be stored.

Actual behavior

config.json and daemon.json are written to the ~/.docker directory, instead of the location specified by DOCKER_CONFIG

Information

  • Diagnostic Id 9070B83F-3875-4E21-99A6-C4443476D704

Steps to reproduce the behavior

  1. Install Docker for Mac (Edge), and set DOCKER_CONFIG environment variable to some path, ~/.docker-example for example.
  2. Start Docker for Mac
  3. Run $ ls ~/.docker
  4. Note the presence of config.json, and daemon.json

@lewiscowper lewiscowper changed the title Docker for Mac (Edge) is not respecting $DOCKER_CONFIG environment variable Docker for Mac (Edge) is not respecting $DOCKER_CONFIG, or $KUBE_CONFIG environment variable Feb 22, 2018

@lewiscowper lewiscowper changed the title Docker for Mac (Edge) is not respecting $DOCKER_CONFIG, or $KUBE_CONFIG environment variable Docker for Mac (Edge) is not respecting $DOCKER_CONFIG, or $KUBECONFIG environment variable Feb 22, 2018

@pgayvallet

This comment has been minimized.

Copy link

pgayvallet commented Feb 23, 2018

Hello,

set DOCKER_CONFIG environment variable to some path

How are you doing this exactly ?

@lewiscowper

This comment has been minimized.

Copy link

lewiscowper commented Feb 23, 2018

@pgayvallet that's within my shell, I realise that Docker for Mac might not source my shell environment, (in fact it almost definitely won't), however I'd love a way to configure where to store config files for Kubernetes + Docker within Docker For Mac.

@pgayvallet

This comment has been minimized.

Copy link

pgayvallet commented Mar 23, 2018

On windows it's working due to how system properties behave.

On OSX, there is no trivial way to add trully global varenv. There seems to be a way, if you want to try though : https://apple.stackexchange.com/questions/106355/setting-the-system-wide-path-environment-variable-in-mavericks. Please note that this is not officially supported.

@lewiscowper

This comment has been minimized.

Copy link

lewiscowper commented Mar 23, 2018

@pgayvallet is it possible to add a setting within Docker for Mac/Windows to set up where to store configuration files?

@docker-desktop-robot

This comment has been minimized.

Copy link
Collaborator

docker-desktop-robot commented Jul 30, 2018

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@jasonkarns

This comment has been minimized.

Copy link

jasonkarns commented Aug 29, 2018

/remove-lifecycle stale

@jasonkarns

This comment has been minimized.

Copy link

jasonkarns commented Aug 29, 2018

reopen, please?

@stefansundin

This comment has been minimized.

Copy link

stefansundin commented Oct 23, 2018

I made a tiny app to help me with this. Instead of launching Docker, I launch Docker-Env, which just runs a shell script before then launching Docker.app. The shell script can set variables (in my case KUBECONFIG), or do anything you want it to do.

Get it here: https://github.com/stefansundin/Docker-For-Mac-Env

But it would definitely be a lot more convenient if something was added to the official app!

@yagi5

This comment has been minimized.

Copy link

yagi5 commented Dec 27, 2018

I found just workaround:

alias docker="docker --config $HOME/.config/docker/"
@lewiscowper

This comment has been minimized.

Copy link

lewiscowper commented Dec 28, 2018

@yagi5 that will change the docker commands that you run from your CLI, but as far as I can tell won't affect where the Mac/Windows App will write config files to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment