bind source path does not exist: /host_mnt - ddev

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

Related

macOS: How to update Docker Desktop that's running on an external drive, without removing existing containers?

I have installed Docker Desktop 3.0 on my mac - on an external drive.
I'm trying to uprade it to latest. I don't get prompted for them and I can't see any option to check for updates in the GUI.
I'd rather not uninstall incase it removes the containers and the data I have set up. But maybe I won't lose them?
can someone point me in the right direction?
thanks.
The location of the files dosn't play role in the upgrade. What plays the major role role is the source version and target version. There are two ways to upgrade the Docker for Mac, and there will be described in detail below:
Incremental upgrade
Upgrade with rebuild (Export / Import)
In the specific case of the upgrade from 3.03 to 3.3, the upgrade to 3.1 and 3.2 can be done as incremental, without need to export / import data, however the upgrade to 3.2.1 will require rebuild of the VM, so the export / import method will help to move the data to the new VM.
Location of data
The application dosn't contain the data for the containers. Docker for macOS is running on a virtual machine, and the data is stored on the virtual disk of the virtual machine.
The raw data (the virtual disk) of the virtual machine is located in
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
Where the 0 is for the 0th VM. By default it's only one VM, but it's better to check. You can find this information from the GUI from Preferences > Resources > Disk Image Location. Simple copy of the content of the data folder will preserve the virtual machine.
Incremental Upgrade
It's always recommended to do incremental upgrade by following the official release versions between your current version and the target version. The releass can be found in the release notes.
The steps to upgrade are:
Stop the docker application (from the menu, find the docker icon and select Quit Docker Desktop
Make full backup of the ~/Library/Containers/com.docker.docker/Data
Rename the application (you might need it to go back, in case the upgrade is not successful)
Copy the new application in the destination and start it.
This steps will be repeated for each minor version between the source version and target version. Some versions can be skipped, however it's not recommended.
In case of problems you can use the troubleshooting guid.
Upgrades with rebuild of the VM
Be aware that upgrading the docker from certain older version to new version might require a rebuild of the virtual machine.
In addition, sometimes the upgrade is not working properly and you will need to uninstall the application as described in the troubleshooting page.
So before you proceed with the uninstall and rebuild of the VM, if you have data that it's important for you, it is highly recommendable to export the containers, volumes and images before the upgrade.
You will need to make a list of all of the containers, images and volumes you want to move across to the new VM. Following docker commands will help:
~# docker ps -a
~# docker volume ls
~# docker image ls
To export the information, you can use the docker export and docker image save. The following example will save the image or the container/volume to file called file.raw:
~# docker export <<volume name or contianer name>> > file.raw
~# docker image save <<image name>> > file.raw
Once the Docker is installed (the latest version) and the VM is rebuild, to import the data back from the files, you will need to use:
~# docker import file.raw
~# docker image load file.raw

docker-compose command not available for mac

I installed docker with the instructions here, downloading from docker-hub
https://docs.docker.com/docker-for-mac/install/
But when I run docker-compose I get this error
pyenv: docker-compose: command not found
The `docker-compose' command exists in these Python versions:
3.6.5/envs/myenv
Also, docker-compose is available under /Users
which docker-compose
/Users/<username>/.pyenv/shims/docker-compose
In this link says, docker-compose for mac need not be installed explicitly as it is part of docker for desktop mac.
https://docs.docker.com/compose/install/
Is something wrong with my installation?
I ran into the same issue on macOS today. Turned out that you need to run the installed app once, it does some additional downloading and setup. That setup includes setting up your path variables.
docker-compose is a utility that is now a parameter in mac docker
so instead of docker-compose up, its now docker compose up
if you install docker from official website then docker-compose will come along with that for mac so need to either upgrade and documentation is present there.

Elastic Beanstalk & Docker - EB CLI Does Not Work on Mac! BUG

When I try and use elastic beanstalk from the command line (ie eb create project) I got the following error.
Select a platform version.
1) Docker 17.03.2-ce
2) Docker 1.12.6
3) Docker 1.11.2
4) Docker 1.9.1
5) Docker 1.7.1
6) Docker 1.6.2
7) Docker 1.5.0
(default is 1): 1
Note: Elastic Beanstalk now supports AWS CodeCommit; a fully-managed source control service. To learn more, see Docs: https://aws.amazon.com/codecommit/
Do you wish to continue with CodeCommit? (y/N) (default is n): n
Do you want to set up SSH for your instances?
(Y/n): y
Select a keypair.
1) patientplatypus
2) phoenixvuenewsly
3) [ Create new KeyPair ]
(default is 2): 1
patientplatypus:~/Documents/newsly_project:11:56:37$eb create newsly_project_production
ERROR: Platform Docker 17.03.2-ce does not appear to be valid
patientplatypus:~/Documents/newsly_project:11:57:44$docker --version
Docker version 17.09.0-ce, build afdb6d4
I thought the above seemed understandable enough, at first. I have version 17.09.0-ce of Docker, but I need version 17.03.2-ce. It would seem reasonable that AWS would be a few versions behind the latest version of Docker if nothing else than to double check system integration and security.
However, when it came time to find version 17.03.2-ce I found it almost impossible. https://github.com/moby/moby/releases points me to 17.03.02-ce as a direct link on the downloads page, which again downloads the wrong version. I tried downloading the link to the static binaries, however that was very confusing. This page https://docs.docker.com/engine/installation/linux/docker-ce/binaries/#next-steps says that in order to get the static binaries to compile I should run the command sudo cp docker/docker /usr/local/bin/, however nowhere in that static binary folder is there a folder labeled docker.
Meanwhile this page https://docs.docker.com/docker-for-mac/release-notes/#docker-community-edition-17090-ce-mac32-2017-10-02-stable, goes from release Docker Community Edition 17.03.1-ce-mac12, 2017-05-12 (stable) to release Docker Community Edition 17.06.0-ce-mac18, 2017-06-28 (stable). Not only does this skip the one release I need, but it seems to have versions that are ahead of the most recent release at https://github.com/moby/moby/releases.
I'm very very confused. It should not be as difficult as this to get the currently stable version of Docker that runs with AWS. Can someone let me know how to resolve this issue?
EDIT:
I spun up my Linux Mint 18 (Ubuntu 16.04) and installed docker to try and get this to work. As it happens linux ALSO installs version Docker version 17.09.0-ce, however this one works with the 1) Docker 17.03.2-ce elastic beanstalk option. All the same commands on a linux environment running the same version of docker now run on eb cli. Therefore I am retitling this post as an EB CLI bug for mac. My question now is, where do I submit a bug report to AWS? I have searched for a github repository for them, but have not found it, and I think that most of their reporting through aws.amazon.com is for enterprise level customers.
Thanks!

Having trouble getting docker to work on mac

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.

Pycharm docker remote python interpreter

When trying to configure a Remote Python Interpreter in Pycharm using Docker I get the following error:
com.github.dockerjava.api.excepion.DockerClientException: Enabled TLS
verification (DOCKER_TLS_VERIFY=1) but certificate path
(DOCKER_CERT_PATH) '/Users/me/.docker/machine/machines/default'
doesn't exist.
I've $export DOCKER_TLS_VERIFY=0 but with no difference.
I've manually created '/Users/me/.docker/machine/machines/default' but with no joy.
I've deinstalled and reinstalled both Docker and Pycharm but still get the same error.
I'm on a Mac OSX 10.12.1
Pycharm 2016.3
Full disclosure: I use vagrant and virtual box on my mac too.
Any pointers would be appreciated.
Kevin
I fixed it as follows:
Obtain socat (if not already installed)
e.g. brew install socat
Then: socat TCP-LISTEN:2375,reuseaddr,fork UNIX-CONNECT:/var/run/docker.sock
Then in pycharm/docker config:
Api URL: tcp://localhost:2375
Many thanks to the following found on:
https://youtrack.jetbrains.com/issue/IDEA-153973
If you have been using docker-machine for Mac to support PyCharm or the "socat" hack to access Docker API - It is no longer necessary with PyCharm EAP (https://www.jetbrains.com/pycharm/nextversion/) — You can set your remote debugger API_URL directly to: unix:/var/run/docker.sock (supporting debug mode, and the environment runs a lot faster, when not using VirtualBox).
There is a no-questions-asked 30 day trial of EAP before that update goes live (some time this month)

Resources