Jörg velletti
Jörg velletti

Reputation: 136

On Windows 10 Home ddev start does not start - Cannot create container for service db: invalid mount config for type "bind"

Today i tried to setup ddev on a maschine of a friend:

OS Windows 10 Home Docker Toolbox - fresh installation Docker Toolbox Quickstart -> pointing that we need to enable the Virtualisation

BIOS -> Virtualisation -> isEnabled Docker Toolbox Quickstart runs.

druds ddev for windows 10 fresh installed ddev config works.

snowm@ThomasWin10HP MINGW64 /c/Data3/test $ ddev start Starting test... Creating ddev-test-db ... error

ERROR: for ddev-test-db Cannot create container for service db: invalid mount config for type "bind": bind mount source path does not exist: /c/Data3/test/.ddev

ERROR: for db Cannot create container for service db: invalid mount config for type "bind": bind mount source path does not exist: /c/Data3/test/.ddev Encountered errors while bringing up the project. Creating ddev-test-db ... error

ERROR: for ddev-test-db Cannot create container for service db: invalid mount config for type "bind": bind mount source path does not exist: /c/Data3/test/.ddev

ERROR: for db Cannot create container for service db: invalid mount config for type "bind": bind mount source path does not exist: /c/Data3/test/.ddev Encountered errors while bringing up the project.'


but for shure that the path exists. :-(


We read this (share Drives with docker), but it looks as the docker toolbox project does not have this GUI: Invalid mount config for type "bind": bind source path does not exist when trying to run container on Docker for Windows

config.yaml looks like this:

APIVersion: v1.2.0
Name: test
type: typo3
docroot: www
php_version: "7.2"
webserver_type: nginx-fpm
router_http_port: "80"
router_https_port: "443"
xdebug_enabled: false
additional_hostnames: []
additional_fqdns: []
provider: default

docker-compose.yaml looks like this

version: '3.6'
#ddev-generated
services:
  db:
    container_name: ddev-${DDEV_SITENAME}-db
    image: $DDEV_DBIMAGE
    stop_grace_period: 60s
    volumes:
      - type: "volume"
        source: mariadb-database
        target: "/var/lib/mysql"
        volume:
          nocopy: true
      - type: "bind"
        source: "${DDEV_IMPORTDIR}"
        target: "/db"
      - type: "bind"
        source: "."
        target: "/mnt/ddev_config"
    restart: "no"
    user: "$DDEV_UID:$DDEV_GID"
    ports:
      - "3306"
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.platform: ddev
      com.ddev.app-type: typo3
      com.ddev.approot: $DDEV_APPROOT
      com.ddev.app-url: $DDEV_URL
    environment:
      - COLUMNS=$COLUMNS
      - LINES=$LINES
    command: "$DDEV_MARIADB_LOCAL_COMMAND"
  web:
    container_name: ddev-${DDEV_SITENAME}-web
    image: $DDEV_WEBIMAGE
    volumes:
      - "../:/var/www/html:cached"
      - ".:/mnt/ddev_config:ro"
    restart: "no"
    user: "$DDEV_UID:$DDEV_GID"
    depends_on:
      - db
    links:
      - db:db
    # ports is list of exposed *container* ports
    ports:
      - "80"
      - "8025"
    working_dir: /var/www/html/${DDEV_DOCROOT}
    environment:
      - DDEV_URL=$DDEV_URL
      - DOCROOT=$DDEV_DOCROOT
      - DDEV_PHP_VERSION=$DDEV_PHP_VERSION
      - DDEV_WEBSERVER_TYPE=$DDEV_WEBSERVER_TYPE
      - DDEV_PROJECT_TYPE=$DDEV_PROJECT_TYPE
      - DDEV_ROUTER_HTTP_PORT=$DDEV_ROUTER_HTTP_PORT
      - DDEV_ROUTER_HTTPS_PORT=$DDEV_ROUTER_HTTPS_PORT
      - DDEV_XDEBUG_ENABLED=$DDEV_XDEBUG_ENABLED
      - DEPLOY_NAME=local
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      - COLUMNS=$COLUMNS
      - LINES=$LINES
      # HTTP_EXPOSE allows for ports accepting HTTP traffic to be accessible from <site>.ddev.local:<port>
      # To expose a container port to a different host port, define the port as hostPort:containerPort
      - HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,8025
      # You can optionally expose an HTTPS port option for any ports defined in HTTP_EXPOSE.
      # To expose an HTTPS port, define the port as securePort:containerPort.
      - HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.platform: ddev
      com.ddev.app-type: typo3
      com.ddev.approot: $DDEV_APPROOT
      com.ddev.app-url: $DDEV_URL
    extra_hosts: ["unneeded:127.0.0.1"]
  dba:
    container_name: ddev-${DDEV_SITENAME}-dba
    image: $DDEV_DBAIMAGE
    restart: "no"
    labels:
      com.ddev.site-name: ${DDEV_SITENAME}
      com.ddev.platform: ddev
      com.ddev.app-type: typo3
      com.ddev.approot: $DDEV_APPROOT
      com.ddev.app-url: $DDEV_URL
    depends_on:
      - db
    links:
      - db:db
    ports:
      - "80"
    environment:
      - PMA_USER=db
      - PMA_PASSWORD=db
      - VIRTUAL_HOST=$DDEV_HOSTNAME
      # HTTP_EXPOSE allows for ports accepting HTTP traffic to be accessible from <site>.ddev.local:<port>
      - HTTP_EXPOSE=8036
networks:
  default:
    external:
      name: ddev_default
volumes:
  mariadb-database:
    name: "${DDEV_SITENAME}-mariadb"

Solution:

We removed everything (~/.ddev ~/.docker etc), uninstalled the docker toolbox and ddev and virtual box and this time followed EXACT this "Step By Step":

  1. FIRST enable Virtualisation in bios settings
  2. then install docker Toolbox as ADMIN and let Docker Toolbox also install virtualbox with ndis network driver (last Checkbox)
  3. Wait and do nothing in meanwhile to be shure to see ACL - Questions
  4. Start virtualbox as Administrator (now the network adapter is created)
  5. RESTART Windows that everything is started correctly
  6. install ddev als Administrator, let him create shortcut and add himself to the windows path
  7. start docker quickstart terminal and let docker Toolbox create a default virtual container
  8. switch to the users home dir

    cd ~ mkdir web cd web mkdir testdomain cd testdomain ddev start

Thanks to fray, as his hint, that ddev project has to be under the users home dir was the main reason why it does not work.

Maybe one or more of the steps above are not important, but as it is now running, i will leave it as it is :-)

Upvotes: 0

Views: 1041

Answers (2)

rfay
rfay

Reputation: 12975

On Docker Toolbox, you can't mount paths outside the home directory without extra config. Only the home directory is shared in the default config. You're trying to mount /c/Data3/test, which is outside the home directory.

If you need to work outside homedir, a quick google of "how to mount outside home directory on docker toolbox" will lead you to links like http://support.divio.com/local-development/docker/how-to-use-a-directory-outside-cusers-with-docker-toolboxdocker-for-windows which explain how to share extra paths using the Virtualbox UI.

Upvotes: 1

user4287110
user4287110

Reputation:

Do you have a firewall or antivirus installed? Sometimes there are blocking the mounting of a drive into docker. Go to the Settings of your Docker service and try to mount the drive manually under the menu "Shared Drives".

I had an issue with the Kaspersky antivirus blocking access to the shared drive. If you have the same, you can try this:

Open a powershell as administrator and use this command:

Get-NetConnectionProfile -InterfaceAlias "vEthernet (DockerNAT)"

If the NetworkCategory is set to Public, set it to Private:

    Set-NetConnectionProfile -InterfaceAlias "vEthernet (DockerNAT)" -NetworkCategory Private

Now you have to modify the ip addesses of the docker interfaces. Go to the system settings and choose the network center. Click on "vEthernet (DockerNat)" -> Properties, activate "Internet protocol, version 4" and click on "Properties". Go to "Advanced" and add the folliwing ip address 10.0.75.254 with subnet mask 255.255.255.0.

Disclaimer: I used that formerly on my German Windows 10 machine. I translated the menu items directly because I switched to Linux and can't see the real names for the menu items.

Upvotes: 2

Related Questions