I am running docker for Mac in latest Mojave. Tried to enable Kubernetes from the preferences. Since then the message is just 'kubernetes is starting'. But it never completes. I am confused as to what has to be done.
Is there anything that I need to change in the network config part?
Just before this, I tried a failed attempt of installing Minikube in the same machine.
I had this same issue on MacOS Catalina. Resetting to factory defaults did finally resolve the issue for me.
Select Troubleshoot from the drop down menu or preferences and click the bug. Then select Reset to factory defaults.
Obviously this is a destructive solution, so use with care.
For me was very useful:
stop docker for desktop
remove the folder ~/Library/Group\ Containers/group.com.docker/pki
rm -rf ~/Library/Group\ Containers/group.com.docker/pki
start docker for destkop
Found the solution here
Related
I have a ddev installation on macOS which I used for a while.
ddev 1.16.2
docker 20.10.0
macOS 11.0.1 - Intel
Today I upgraded to docker 20.10.0 and in the process to ddev 1.16.2.
When I start an existing site, that worked all the time I get
Creating ddev-mysite-db ... error
ERROR: for ddev-mysite-db Cannot create container for service db: invalid mount config for type "bind": bind source path does not exist: /host_mnt/Users/me/Documents/Development/WebSite/mysite/.ddev
This started to happen after I upgraded docker from the previous version. Upgrading ddev did not change too much.
Even when I create a new site, the same error message pops up so I am pretty much stuck.
At least for me it looks like the docker 20.10.0 breaks ddev. Any ideas how to deal with that are very much appreciated.
Docker/macOS are not allowing access to the directory ~/Documents.
Starting with macOS Catalina, ~/Documents is a "protected directory", so you have to allow docker access to it, and docker should prompt.
However, Docker Desktop for Mac's 3.0.0 release (which I imagine you're referring to) had a bug where it did not do this properly. I imagine you need to upgrade to version 3.0.1 which was released today. Just "Check for updates"
In Docker > Preferences > Experimental features you can try disabling gRPC, and make Docker use osxfs file sharing system.
Reference: https://github.com/docker/for-mac/issues/4859#issuecomment-689012097
I am trying to run any GUI container I can on MacOS. With every container I try (firefox, chrome, tor, spotify, etc) I always get the error Error: cannot open display. And it's not specific to the docker run command where I pass the environment flag with my $DISPLAY. When I try to run xhost + I get the same error.
I have a fresh XQuartz installation. It is up and running. I have turned on "allow connections from network" under security. I've tried building my own images and pulling jessie frazelle's images. I do not suspect it is a docker issue or the Dockerfiles. It is something on the host, my laptop. I can't seem to figure out what it is.
MacOS Sierra 10.12.5
Docker 17.12.0 Stable
XQuartz 2.7.11 (xorg-server 1.18.4)
My local's $DISPLAY is set to :0.0
So I finally got this to work. And it seems it was pretty simple. I am not certain how this actually fixes the issue, but now the containers work.
How I fixed it was opening up XQuartz and then opening up the "Terminal" app from the "Applications" menu. Then running the command export DISPLAY=192.168.1.X:0, then xhost +. It outputted something like this "access control disabled, clients can connect from any host". After that I was able to run my docker run commands to launch the desired GUI containers.
I am still uncertain how this works and not running them from my laptops Terminal app, but it worked. It must be something I have set in my local env. Hopefully this helps someone else out who may be running into the same issues.
Based on #Byron's answer, I've found out that I could get it to work by running these 2 commands in the normal terminal:
export DISPLAY=:0
/opt/X11/bin/xhost +
OK so here is what I have done so far. I installed docker for mac, and that worked fine. From there I tried to get a project up and running using docker-compose and I got the following error:
Could not read CA certificate "/Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem": open /Users/<useraccountfolder>/.boot2docker/certs/boot2docker-vm/ca.pem: no such file or directory
So I tried to fix it by trying this accepted answer. This is when I got another error, Host does not exist: “default”. This is when I trie this accepted answer, but when I tried to run docker-machine create default, I got this error: Error with pre-create check: "VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path". I am just lost at this point. Any help?
To use docker machine you need the latest version of VirtualBox, from the docker docs:
IF YOU ARE USING DOCKER FOR MAC
Docker for Mac uses HyperKit, a lightweight macOS virtualization solution built on top of the Hypervisor.framework in macOS 10.10 Yosemite and higher.
Currently, there is no docker-machine create driver for HyperKit, so you will use virtualbox driver to create local machines. (See the Docker Machine driver for Oracle VirtualBox.) Note that you can run both HyperKit and Oracle VirtualBox on the same system. To learn more, see Docker for Mac vs. Docker Toolbox.
Make sure you have the latest VirtualBox correctly installed on your system (either as part of an earlier Toolbox install, or manual install).
Source: https://docs.docker.com/machine/get-started/#prerequisite-information
OK so I found a solution which is probably not fixing the root issue, but it does work. To unset previous variables I ran this command unset ${!DOCKER*}. This worked, but then I had to run it every time I started a new terminal session, so I added it to my .bash_profile and now I am good.
I'm using Docker for mac.
I'd like to restart this Docker-for-mac App with command on Terminal.
What's the command?
There was no documentation for this.
I had do restart it by clicking that button anytime that I needed to.
Forcing Docker for Mac to re-read its config with
killall -HUP com.docker.hyperkit
might work - if it doesn't, please explain in more detail why you need to restart Docker in the first place.
For me I needed to restart Docker so I could install the new version
killall Docker did the trick.
I'm running on Mac OS X 10.6.8 Snow Leopard.
FYI: I can't upgrade my OS so that is not an option for me right now.
So, I install boot2docker and when I go click on the icon I receive the following output:
username#My-Mac:~$ bash
username#My-Mac:~$ unset DYLD_LIBRARY_PATH ; unset LD_LIBRARY_PATH
username#My-Mac:~$ mkdir -p ~/.boot2docker
username#My-Mac:~$ if [ ! -f ~/.boot2docker/boot2docker.iso ]; then cp /usr/local/share/boot2docker/boot2docker.iso ~/.boot2docker/ ; fi
username#My-Mac:~$ /usr/local/bin/boot2docker init
/usr/local/bin/boot2docker up
$(/usr/local/bin/boot2docker shellinit)
docker version
error in run: Failed to initialize machine "boot2docker-vm": exit status 1
username#My-Mac:~$ /usr/local/bin/boot2docker up
error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)
username#My-Mac:~$ $(/usr/local/bin/boot2docker shellinit)
error in run: Failed to get machine "boot2docker-vm": machine does not exist (Did you run `boot2docker init`?)
username#My-Mac:~$ docker version
Client version: 1.6.0
Client API version: 1.18
Go version (client): go1.4.2
Git commit (client): 4749651
OS/Arch (client): darwin/amd64
FATA[0000] Get http:///var/run/docker.sock/v1.18/version: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?
username#My-Mac:~$
What does this mean? How can I fix this?
I ran into the same issue. You need to set the environment variables in your shell. Run the following:
eval "$(boot2docker shellinit)"
Since it is only persistent per shell you'll need to add it to your ~/.bashrc, ~/.bash_profile, .zshrc, or whatever other shell profile you need it to run in.
Here is a good example of a plist for auto starting boot2docker. You'll have to modify the plist so the working directory matches yours. https://gist.github.com/krak3n/0f7fe4c3c5828767ec5b
I've installed Kitematic (Version 0.5.19 which is Beta as of this writing) as well as boot2docker on my system. Kitematic does not install a plist for auto starting your boot2docker instance. It boots when you start Kitematic. It most likely shuts it down on close which means your containers that are running will shutdown as well.
Ultimately it is up to how you want to setup and run your environment. If you're going only boot2docker and docker CLI and want things running at boot, create the plist and set your .bash_profile/.zshrc. If you want a GUI and CLI option that only boots and runs when you want it to then Kitematic is the way to go.
The answer above is correct, but you don't need the eval, you can just use:
$(boot2docker shellinit)
You can put this in your .profile
echo '$(boot2docker shellinit)' >> ~/.profile
and then it is setup every time you create a new shell.
This might be a duplicate of a previous question I answered:
Docker TLS error on Mac
After much hassle and delegation I was able to finally figure out what was going on. It was xanderlopez in this post that got me to realize that the problem lied with my shared folder and virtual machine folder locations for VitualBox. After changing the shared folder and renaming the location for the VM to "VirtualBox VMs", once I reinstalled boot2docker, everything ran as was supposed to and the hello world verification succeeded. So that's a gotcha right there. The location of your vm must be inside a folder named "VirtualBox VMs". The location seems to be unimportant as I just created a subfolder folder inside the folder that I was already using. Not sure how that works but it seems to have worked which is good enough for this issue. If I see any problems up ahead later related to the folder structure I'll be sure to reference this post.